|
26 | 26 | </signature>
|
27 | 27 | <desc>Insert content, specified by the parameter, to the end of each element in the set of matched elements.</desc>
|
28 | 28 | <longdesc>
|
29 |
| - <p>The <code>.append()</code> method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the <em>first</em> child, use <a href="http://api.jquery.com/prepend/"><code>.prepend()</code></a>). </p> |
30 |
| - <p>The <code>.append()</code> and <code><a href="/appendTo">.appendTo()</a></code> methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With <code>.append()</code>, the selector expression preceding the method is the container into which the content is inserted. With <code>.appendTo()</code>, on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.</p> |
| 29 | + <p>The <code>.append()</code> method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the <em>first</em> child, use <a href="/prepend/"><code>.prepend()</code></a>). </p> |
| 30 | + <p>The <code>.append()</code> and <code><a href="/appendTo/">.appendTo()</a></code> methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With <code>.append()</code>, the selector expression preceding the method is the container into which the content is inserted. With <code>.appendTo()</code>, on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.</p> |
31 | 31 | <p>Consider the following HTML:</p>
|
32 | 32 | <pre><code>
|
33 | 33 | <h2>Greetings</h2>
|
@@ -68,7 +68,7 @@ $( ".container" ).append( $( "h2" ) );
|
68 | 68 | </code></pre>
|
69 | 69 | <p>If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.</p>
|
70 | 70 | <h4 id="additional-arguments">Additional Arguments</h4>
|
71 |
| - <p>Similar to other content-adding methods such as <code><a href="http://api.jquery.com/prepend/">.prepend()</a></code> and <code><a href="http://api.jquery.com/before/">.before()</a></code>, <code>.append()</code> also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.</p> |
| 71 | + <p>Similar to other content-adding methods such as <code><a href="/prepend/">.prepend()</a></code> and <code><a href="/before/">.before()</a></code>, <code>.append()</code> also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.</p> |
72 | 72 | <p>For example, the following will insert two new <code><div></code>s and an existing <code><div></code> as the last three child nodes of the body:</p>
|
73 | 73 | <pre><code>
|
74 | 74 | var $newdiv1 = $( "<div id='object1'/>" ),
|
|
0 commit comments