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 |
You get "jquery is not defined" or "$ is not defined" error. What could be the reason?
What are the guidelines for an application to follow the principles of progressive enhancement.
Whether we need to add jQuery file in both Master and Content page?
What is the difference between jquery and javascript?
How to use jquery?
What does dollar sign mean in jquery? : jQuery Mobile
How to get the style property of an element using ?
How to get the server response from an ajax request using jquery?
How we can modify the css class in jquery?
In what situation you would use multiple version of jQuery and how would you include them?
Which is the starting point of code execution in jQuery?
Can we use jQuery to make ajax request?