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 |
What is the difference between event.PreventDefault and "return false"?
What are selectors in jQuery and how many types of selectors are there?
What does dollar sign ($) means in jQuery?
What are source maps in jQuery?
How to use connect?
How can you add a jquery library in your project?
What is the use of jQuery filter?
Explain the use of the $.fn.bind and $.fn.trigger.
Is jquery html() method works for both html and xml documents?
How jQuery selectors are executed?
What is $('div')? : jquery mobile
Change the url for a hyperlink using jquery?