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 are source maps in jQuery?
What is jquery selectors? Give some examples.
How can you use a jquery library in your project?
What are different type of selector in jQuery?
Suppose if you have a server control(asp.net server control, button) and on the click of button you want to call a jquery function, so tell me how you will call a jquery function without postback?
Can we use jQuery to make ajax request?
How do you select all elements with the class of “selected” in jquery?
Difference Between Prop and Attr in jQuery?
Which is the starting point of code execution in jQuery?
What are the advantages of minified version of jquery?
What is jQuery?
Differentiate between width() vs css(‘width’) in jquery