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