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
Have any of your startup projects failed dismally - if so, why and how did you learn from them?
Is jquery still relevant 2019?
Where jQuery code is getting executed?
Change the url for a hyperlink using jquery?
What are the effects methods used in jquery?
Explain remove class jquery with example?
How to use connect?
Explain the common methods of sending a request to a server.
Explain the use of each function in jquery?
Please tell us that is jquery knockkout intended to compete with jquery or prototype or work with it?
How do you check or uncheck a checkbox input or radio button?
Define bind() and unbind elements in jQuery?
Can we select a element having a specific class in jquery ?
What is the difference between find and children methods?
Tell me can we have multiple document.ready() function on the same page? : jquery mobile