Does events are also copied when you clone any element in jQuery?



Does events are also copied when you clone any element in jQuery?..

Answer / chaitanya

As explained in previous question, using clone() method, we can create clone of any element but the default implementation of the clone() method doesn't copy events unless you tell the clone() method to copy the events. The clone() method takes a parameter, if you pass true then it will copy the events as well.

Hide Copy Code

$(document).ready(function(){

$("#btnClone").bind('click', function(){

$('#dvClickme').clone(true).appendTo('body');

});

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

Differentiate between jquery.size and jquery.length? : jQuery Mobile

0 Answers  


What are the the two types of cdns?

0 Answers  


Explain the difference between onload() and document.ready() function used in jquery?

0 Answers  


With jquery which operating system is more compatible?

0 Answers  


What is .empty()? : jquery mobile

0 Answers  






Which is the fastest selector in jQuery?

0 Answers  


Please tell us that is jquery knockkout intended to compete with jquery or prototype or work with it?

0 Answers  


Why is only the first page of multi page document loaded? : jquery mobile

0 Answers  


What is the use of queue() in jquery?

0 Answers  


What is $() in jquery?

0 Answers  


Which one is more efficient, document.getElementbyId( "myId") or $("#myId)?

0 Answers  


How to write browser specific code using jquery? : jquery mobile

0 Answers  


Categories