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 a cdn? : jQuery Mobile

0 Answers  


With jquery which operating system is more compatible?

0 Answers  


Tell me do I need to add the jquery file both at the master page and content page as well?

0 Answers  


How to programmatically trigger a click event that's being handled by jquery?

0 Answers  


Change the url for a hyperlink using jquery?

0 Answers  






What are the the two types of cdns?

0 Answers  


What are the various ajax functions?

0 Answers  


What are the types of selectors in jQuery?

0 Answers  


What is the goal of cdn and what are the advantages of using cdn?

0 Answers  


How JavaScript and jQuery are different?

1 Answers  


How we can modify the css class in jquery?

0 Answers  


What is the difference between onload() and document.ready() function used in jquery?

0 Answers  


Categories