Home >>jQuery Tutorial >jQuery appendTo() Method

jQuery appendTo() Method

jQuery appendTo() Method

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


Parameter Values

Parameter Description
content It is a Required parameter and is used to insert the Specifies the content (must contain HTML tags).
selector It is Required parameter used to Specifies to append the content of selected element
Here is an Example of jQuery appendTo() Method:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
$("<span>Hello phptpoint!</span>").appendTo(".txt1");
<button class="btn1">click me to insert element</button>
<p class="txt1">This is a paragraph...</p>
<p class="txt1">PHPTPOINT...</p>


This is a paragraph...


No Sidebar ads