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 |
What is jquery.holdready() function?
How to get/set the html contents of an element using jQuery?
What is the difference between jquery's ready and holdready?
what are the features of jquery
What are selectors in jquery?
What is the difference between event.PreventDefault and event.stopPropagation?
What is .empty()? : jquery mobile
What are all the ways to include jQuery in a page?
Can you please explain the difference between parent() and parents() methods in jquery? : jquery mobile
What is the use of html() method in jquery?
Why use jQuery filter() Methods?
How to select class in jquery?