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
People usually stumble onto the 461 visa when they realise there’s no simple way to…
In today’s digital era, people look for convenience, transparency, and genuine rewards from their financial…
If you are planning to start a lighting business and looking for a supplier of…
If you are a copywriter or a content marketer, you will second my statement that…
Motorcycle accidents often lead to severe injuries because riders have minimal protection compared to drivers…
No business owner starts his or her business with the hope of making losses. Everyone…