$(document).ready(function () { $("#myButton").click(function () { $("#cloneDiv").clone().appendTo($('#targetDiv')); }); });
<html> <head> <title>clone</title> </head> <body> <div id="cloneDiv"> This is div element. <p>This is p element inside div element.</p> <p>clone() performs deep copy, that is not only copies the matched elements but also their descendants and text nodes.</p> </div> <div id="targetDiv"> </div> <input type="button" id="myButton" value="Clone"/> <input type="button" id="reset" value="Reset" onclick="location.reload()" /> </body> </html>