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 |
Explain the use of each function in jquery?
How do you check if an element is empty?
Explain why there are two different version of jquery library? : jquery mobile
Does jQuery 2.0 supports IE?
Explain remove class jquery with example?
Explain the each() function?
Define slidetoggle() effect?
Explain event.preventdefault? : jquery mobile
Explain each() function in jquery?
How can events be prevented from stopping to work after an ajax request?
What is the difference between the knockout and jquery?
How do you disable or enable a form element?