Immediately I say in js is rather weak. In general, the question is the following block. In it there is a form which is processed through ajax. I wrote a plugin that copies this block to another location (for me, for example, http://jsfiddle.net/wre1bk27/ ). Accordingly, it already kills all event handlers. The code is simple:
div = $(element).html(); innerdiv = '<li><span class="close"></span>'+div+'</li>'; $(innerdiv).insertAfter(ul.find('li').eq(el_num));
In general, hint how to do it right. In my place where the form is inserted a block with an ID, and with this copying I obviously break the DOM.
.on()
, which in this context will be incorrect, and using .clone () , which allows you to copy an element with handlers. - etki