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 |
Define jquery filter?
What is the purpose of jquery?
How to use css() in jquery?
What are the advantage of using minimized version of jquery?
List the advantages of jquery?
Explain chaining in jquery? : jquery mobile
What is the advantage of using protocol less URL while referencing jQuery from CDNs?
What is the difference between find and children methods?
Explain the term method chaining? : jQuery Mobile
What does dollar sign ($) means in jQuery?
Why jquery?
Difference between parent() and parents() in jQuery?