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 |
Why is the block display style used for animations?
Define each() function in jquery?
How can events be prevented to work after an ajax request?
How can you select all elements in a page using jquery?
What is the use of each function in jQuery?
How to get the current offset of the first matched element, in pixels, relative to the document using ?
What are the slow selectors in jquery? : jquery mobile
How you will use jquery means requirement needed for using jquery.
How to validate phone number using jquery?
What is the difference between "#" and "." selector in JQuery?
How does jquery mobile theming work? : jquery mobile
What are some of the ways to provide effects? : jQuery Mobile