Saturday, 24 August 2013

Previous Interview Question Next Interview Question
Home

How to create clone of any object using jQuery?

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.
$(document).ready(function(){
  $('#btnClone').click(function(){
     $('#dvText').clone().appendTo('body');
     return false;
  });
});

Previous Interview Question Next Interview Question
Home

0 comments :

Post a Comment