jQuery append and append to example

In this post,  we are going to see jQuery append and appendTo methods.

Both do the same task, insert text or html after content of every selected elements, so it will put text or html to last index of selected element. Both methods add text or html as a child to selected elements .Syntax is quite different for append and appendTo methods.
Syntax for append() :

inserting using append

Syntax for appendTo() :

inserting using appendTo

Let’s understand with the help of example:
Live demo: Jquery append and appendTo example on jsbin.com

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *