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

Please explain remove class jquery with example?

0 Answers  


Tell me does jquery 2.0 supports ie? : jquery mobile

0 Answers  


What are some of the ways to provide effects? : jQuery Mobile

0 Answers  


With jquery ui 1.7 being released in the last few days, what do you see as the key parts of jquery ui 1.7? What are you most proud of out of that release?

0 Answers  


How do you check or uncheck a checkbox input or radio button?

0 Answers  






How to disable cut,copy and paste in TextBox using jQuery?

0 Answers  


Tell me how to disable jquery animation? : jquery mobile

0 Answers  


Is jQuery is a client or server scripting?

0 Answers  


How can you get the type of arguments passed to a function?

0 Answers  


Define type paremeter of jquery ajax method?

0 Answers  


Can we use protocol less URL while referencing jQuery from CDNs?

1 Answers  


Whether jQuery HTML work for both HTML and XML documents?

0 Answers  


Categories