The jQuery clone() Method creates a deep run time copy of set of matched DOM Elements to another location in the DOM elements and select the clones.
This is very useful for run time copies of the elements to another location in the DOM elements.
$(selector).clone(true|false)
true: specifies the event handlers which should be copied
false: default. specifies the event handlers should not be copied
Read jQuery reference for more details.
<p>This is a first paragraph.</p> <p>This is a second paragraph.</p>
<script> $(document).ready(function(){ $("p").clone().appendTo("body"); }); </script>
In the above example, it clone all <p> elements and then insert them at the end of the <body> element.
Must Read: Add table row dynamically in jQuery
In a world where digital presence is paramount, the question isn't whether you should do…
Over the years, people have experimented with various methods to maintain healthy and beautiful hair.…
Your brand more than developing an attractive and creative logo and infectious motto. It's the…
Introduction Are you someone who has suffered from a personal injury and want to file…
Operating from home has emerged as one of the most popular ways of doing jobs…
If the consequences of our society’s ever-growing debt are what worries you, then it is…