Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to create clone of any object using jQuery?

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


Please Help Members By Posting Answers For Below Questions

Explain which program is useful for testing jquery?

9004


Explain .live()? : jquery mobile

746


Explain .empty() vs .remove() vs .detach().

824


What is each() function in jQuery? How do you use it?

740


How do I check if an HTML element is empty using jQuery?

804


How to search for descendant elements that match the specified selectors using ?

726


How can related code be encapsulated? Give example.

726


How to use jquery.connect?

762


Is jquery a library for client scripting or server scripting? : jquery mobile

686


Is Uncaught TypeError: $(…).modal not a function jquery?

799


How do you add an HTML element in DOM tree?

789


What is meant by a deep copy? : jQuery Mobile

736


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

823


What is a dom in jquery? How can we make sure that dom is ready?

732


How to get the server response from an ajax request using jquery?

793