How to create clone of any object using jQuery?
Answer / chaitanya
jQuery provides clone() method which performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes.
Hide Copy Code
$(document).ready(function(){
$('#btnClone').click(function(){
$('#dvText').clone().appendTo('body');
return false;
});
});
| Is This Answer Correct ? | 1 Yes | 0 No |
How to load jQuery locally when CDN fails?
How to execute jQuery code after the DOM is ready?
What is the difference between the knockout and jquery?
What is the latest version of jquery?
Will Events Are Also Copied On Clone In Jquery?
How can jquery be used in conjunction with another javascript library that also uses $ for naming?
What is jQuery UI?
What is jquery.holdready() function?
How to disable/enable an element in jquery?
Define data paremeter of jquery ajax method?
How do you get the text value of a selected option?
What is a jquery ?