Skip to content

Commit eb7611d

Browse files
committed
parent: Clarify wording about behavior
Fixes gh-537 Ref gh-543
1 parent e77a192 commit eb7611d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

entries/parent.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</signature>
1010
<desc>Get the parent of each element in the current set of matched elements, optionally filtered by a selector.</desc>
1111
<longdesc>
12-
<p>Given a jQuery object that represents a set of DOM elements, the <code>.parent()</code> method allows us to search through the parents of these elements in the DOM tree and construct a new jQuery object from the matching elements.</p>
13-
<p>The <code><a href="/parents/">.parents()</a></code> and <code>.parent()</code> methods are similar, except that the latter only travels a single level up the DOM tree. Also, <code>$( "html" ).parent()</code> method returns a set containing <code>document</code> whereas <code>$( "html" ).parents()</code> returns an empty set.</p>
12+
<p>Given a jQuery object that represents a set of DOM elements, the <code>parent()</code> method traverses to the immediate parent of each of these elements in the DOM tree and constructs a new jQuery object from the matching elements.</p>
13+
<p>This method is similar to <a href="/parents/"><code>.parents()</code></a>, except <code>.parent()</code> only travels a single level up the DOM tree. Also, <code>$( "html" ).parent()</code> method returns a set containing <code>document</code> whereas <code>$( "html" ).parents()</code> returns an empty set.</p>
1414
<p>The method optionally accepts a selector expression of the same type that we can pass to the <code>$()</code> function. If the selector is supplied, the elements will be filtered by testing whether they match it.</p>
1515
<p>Consider a page with a basic nested list on it:</p>
1616
<pre><code>

0 commit comments

Comments
 (0)