How to create clone of any object using jQuery?



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

Post New Answer

More jQuery Interview Questions

What is the difference between jquery and javascript?

0 Answers  


How do you update ajax response with id " resilts"?

0 Answers  


Explain some benefits of jquery knockout?

0 Answers  


Write a basic jquery code?

0 Answers  


What are jquery plugins?

0 Answers  






How to check or uncheck all checkboxes using jquery?

0 Answers  


How can we add change font size using jquery?

0 Answers  


Can we have multiple document.ready() function on the same page? : jquery mobile

0 Answers  


How we can get the input value of an element using jquery?

0 Answers  


Does jQuery 2.0 supports IE?

3 Answers  


What is the purpose of jquery?

0 Answers  


Different ways of using $.connect function in jquery?

0 Answers  


Categories