jQuery appendTo() Method

Last Updated Jul 21, 2015, 12:00:06 PM





jQuery appendTo() Method

jQuery appendTo() method is used to insert HTML elements at the end of the selected HTMLelement .


Syntax

Note that, jQuery .append() and jQuery .appendTo() methods in jQuery performs the same task. The main difference is syntax i.e., placing content and target.

Example HTML
jQuery

The above jquery appendTo method will append new text as jQuery to the paragraphs when you click the Append text button.

When you click the second button named Append list it will keep appending a new list item named new item

The above jquery appendTo method example will produce the following output


jQuery appendTo() method
Try It Now

jQuery DOM Reference

Other Advanced jQuery and DOM topics you might want to learn

jQuery Basic DOM Methods

jQuery DOM Removal

jQuery DOM Insertion Inside

jQuery DOM Insertion Outside

jQuery DOM Insertion Around


Sources and Credits

The content and methods in the tutorial has been referred and updated with jQuery API and The jQuery Foundation

Last Updated Jul 21, 2015, 12:00:06 PM