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

Tell me which command will give a version of jquery?

0 Answers  


How to get the style property of an element using ?

0 Answers  


What is $() in jquery library?

0 Answers  


Can we add more than one ‘document.ready’ function in a page?

0 Answers  


What are the difference between alert() and confirm()?

0 Answers  


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

0 Answers  


Please tell us that is jquery knockkout intended to compete with jquery or prototype or work with it?

0 Answers  


What is difference between onload and ready?

0 Answers  


Back onto jquery ui' can you see jquery ui making more of an impression in the future, lead by the current successes of jquery?

0 Answers  


What are the advantage of using minimized version of jquery?

0 Answers  


Can you include multiple version of jQuery? If yes, then how they are executed?

1 Answers  


Tell me how to check if number is numeric while using jquery 1.7+? : jquery mobile

0 Answers  


Categories