Friday, September 30, 2011

appendTo(<Content>)

appendTo(<Content> content) returns jQuery
Append all of the matched elements to another, specified, set of elements. This operation is, essentially, the reverse of doing a regular $(A).append(B), in that instead of appending B to A, you're appending A to B.

Example:


Appends all paragraphs to the element with the ID "foo"
$("p").appendTo("#foo");

HTML:
<p>I would like to say: </p><div id="foo"></div>

Result:
<div id="foo"><p>I would like to say: </p></div>

No comments:

Post a Comment