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
Battery coating is the process of applying uniform layers of active materials—such as cathode and…
Let’s face it. Tech buzzwords get thrown around a lot—especially when it comes to how…
In today’s digital world, the boundaries between technology, finance, and innovation are rapidly disappearing. Businesses…
Backyard gatherings like BBQs, family reunions, and garden parties are an exciting way to enjoy…
Marketers are always on the lookout for more effective ways to reach their target audiences.…
Does your phone control your mind more than you control your phone? Modern life exploits…