felito Posted May 12, 2011 Share Posted May 12, 2011 hi i have this code: http://jsfiddle.net/FYHzv/ What reason the new cloned div is not associated to: $("#one2 .area").change(function(){ alert('changed'); }); i dynamically generate a new id. The first cloned object is: div id="one2" thanks! Quote Link to comment https://forums.phpfreaks.com/topic/236237-problem-with-clone/ Share on other sites More sharing options...
requinix Posted May 12, 2011 Share Posted May 12, 2011 .clone(false) http://api.jquery.com/clone/ .clone( [ withDataAndEvents ] ) withDataAndEvents A Boolean indicating whether event handlers should be copied along with the elements. As of jQuery 1.4, element data will be copied as well. Quote Link to comment https://forums.phpfreaks.com/topic/236237-problem-with-clone/#findComment-1214588 Share on other sites More sharing options...
felito Posted May 12, 2011 Author Share Posted May 12, 2011 if i put clone (true) the event is absolutely copied, but not associated to one2. So the alert that is showed is always the same. you can seen: http://jsfiddle.net/UGAuv/ Quote Link to comment https://forums.phpfreaks.com/topic/236237-problem-with-clone/#findComment-1214590 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.