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 |
What is the between $(this) and 'this' in jquery?
How to disable cut,copy and paste in TextBox using jQuery?
What is .siblings() method in jquery?
How to write browser specific code using jQuery?
How to multiple AJAX requests be run simultaneously in jQuery?
Explain width() vs css(‘width’)?
What is ajax and how it works?
What are selectors in jQuery and how many types of selectors are there?
What are the four parameters used for jQuery Ajax method?
Explain remove class jquery with example?
Can you use multiple document.ready() function on the same page?
Is vanilla js faster than jquery?