How to use HTML AppendTo Method in JQuery

This article describe about HTML AppendTo Method in JQuery.
  • 2138

HTML appendTo() method in jQuery

The appendTo method is used to insert an element on the selected position.

This appendTo method add the element at the end position of the selected element.

The Append method and AppendTo method both are same thing but the syntax will be different.




<!DOCTYPE html>



<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">

    $(document).ready(function ()


        $("button").click(function ()


            $("<b>Hello World!</b>").appendTo("p");






<p>This is a JQuery.</p>

<p>This is .Netheaven.</p>

<button>Insert content after click this button</button>







You may also want to read these related articles here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.