Does events are also copied when you clone any element in jQuery?
Answer Posted / 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 View All Answers
How do you select all elements with the class of “selected” in jquery?
What are the guidelines for an application to follow the principles of progressive enhancement.
Can you write a jquery code to select all links inside the paragraph?
What is jquery.length? : jquery mobile
What are the advantages of method chaining in jquery?
What is the basic requirement to start with the jquery?
How to programmatically trigger a click event thats being handled by jquery only?
What is the use of delegate() method in jquery?
explain width() vs css(‘width’) in jquery
Define jquery filter?
What is jquery.holdready() function?
How to use jquery?
How to programmatically trigger a click event that's being handled by jquery?
How to read cookies in jquery?
How can related code be encapsulated?