<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='docs.xsl'?>
<docs>
<method cat='DOM/Attributes' type='String' short='Get the text contents of all matched elements.' name='text'>
<desc>Get the text contents of all matched elements. The result is
a string that contains the combined text contents of all matched
elements. This method works on both HTML and XML documents.</desc>
<examples>
<desc>Gets the concatenated text of all paragraphs</desc>
<before>&lt;p&gt;&lt;b&gt;Test&lt;/b&gt; Paragraph.&lt;/p&gt;&lt;p&gt;Paraparagraph&lt;/p&gt;</before>
<code>$("p").text();</code>
<result>Test Paragraph.Paraparagraph</result>
</examples>
</method><method cat='DOM/Attributes' type='String' short='Set the text contents of all matched elements.' name='text'>
<desc>Set the text contents of all matched elements.

Similar to html(), but escapes HTML (replace "&lt;" and "&gt;" with their
HTML entities).</desc>
<params type='String' name='val'>
<desc>The text value to set the contents of the element to.</desc>
</params>
<examples>
<desc>Sets the text of all paragraphs.</desc>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").text("&lt;b&gt;Some&lt;/b&gt; new text.");</code>
<result>&lt;p&gt;&amp;lt;b&amp;gt;Some&amp;lt;/b&amp;gt; new text.&lt;/p&gt;</result>
</examples>
<examples>
<desc>Sets the text of all paragraphs.</desc>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
<code>$("p").text("&lt;b&gt;Some&lt;/b&gt; new text.", true);</code>
<result>&lt;p&gt;Some new text.&lt;/p&gt;</result>
</examples>
</method></docs>
