Skip to content

Commit e45384e

Browse files
committed
Types: Added Text
1 parent 8c1b607 commit e45384e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pages/Types.html

+12
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<li class="toclevel-1"><a href="#Selector"><span class="toctext">Selector</span></a></li>
8989
<li class="toclevel-1"><a href="#Event"><span class="toctext">Event</span></a></li>
9090
<li class="toclevel-1"><a href="#Element"><span class="toctext">Element</span></a></li>
91+
<li class="toclevel-1"><a href="#Text"><span class="toctext">Text</span></a></li>
9192
<li class="toclevel-1"><a href="#jQuery"><span class="toctext">jQuery</span></a></li>
9293
<li class="toclevel-1"><a href="#XMLHttpRequest"><span class="toctext">XMLHttpRequest</span></a></li>
9394
<li class="toclevel-1"><a href="#jqXHR"><span class="toctext">jqXHR</span></a></li>
@@ -604,6 +605,17 @@ <h2 id="Element"> Element </h2>
604605
</code></pre>
605606
<p>You could replace <code>this.value</code> with <code>$(this).val()</code> to access the value of the text input via jQuery, but in that case you wouldn't gain anything.
606607
</p>
608+
<h2 id="Text"> Text </h2>
609+
<p>Text is a node of the Document Object Model (DOM) that represents the textual content of an <a href="#Element">element</a> or an attribute. Consider the following code:
610+
</p>
611+
<pre><code data-lang="html">&lt;p id=&quot;target&quot;&gt;&lt;b&gt;Hello&lt;/b&gt; world&lt;/p&gt;
612+
</code></pre>
613+
<p>If you retrieve the children of the paragraph of the example as follows:
614+
</p>
615+
<pre><code data-lang="javascript">var children = document.getElementById( "target" ).childNodes;
616+
</code></pre>
617+
you obtain two children. The first one is the <a href="#Element">element</a> representing the <code>b</code> tag. The second child is a text node containing the string " world".
618+
</p>
607619
<h2 id="jQuery"> jQuery </h2>
608620
<p>A jQuery object contains a collection of Document Object Model (DOM) elements that have been created from an HTML string or selected from a document. Since jQuery methods often use CSS selectors to match elements from a document, the set of elements in a jQuery object is often called a set of "matched elements" or "selected elements".
609621
</p>

0 commit comments

Comments
 (0)