Example of .appendTo() in jQuery
February 21, 2013
In jQuery, .appendTo() is the API that appends every matched elements with target element. .appendTo() can be called as
$("p").appendTo("#divid");
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <p>World!</p> <div id="divid">Hellow</div> <script> $("p").appendTo("#divid"); </script> </body> </html>
Hellow
World!