Answer Posted / 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 View All Answers
Explain which program is useful for testing jquery?
Explain .live()? : jquery mobile
Explain .empty() vs .remove() vs .detach().
What is each() function in jQuery? How do you use it?
How do I check if an HTML element is empty using jQuery?
How to search for descendant elements that match the specified selectors using ?
How can related code be encapsulated? Give example.
How to use jquery.connect?
Is jquery a library for client scripting or server scripting? : jquery mobile
Is Uncaught TypeError: $(…).modal not a function jquery?
How do you add an HTML element in DOM tree?
What is meant by a deep copy? : jQuery Mobile
What are the difference between alert() and confirm()?
What is a dom in jquery? How can we make sure that dom is ready?
How to get the server response from an ajax request using jquery?