Skip to navigation
Append a cloned and changed html element with jquery
16.03.16
jQuery('#clone_btn').click(function() { var e = jQuery(".agenda_row").last(); var i = jQuery('.agenda_row').size(); var new_box = jQuery(e).clone(); new_box.find(".slidefollow").attr("id" , "slideFollow_"+i); new_box.find(".slidefollow").attr("name", "follow["+i+"]"); new_box.find(".sidefollowlabel").attr("for" , "slideFollow_"+i); new_box.find(".topic").attr("name" , "topic["+i+"]"); new_box.find(".agenda_content").attr("name" , "agenda_content["+i+"]"); new_box.appendTo(jQuery("#agenda_inside")).insertBefore('#button_agenda'); i++; });
http://api.jquery.com/clone/
Reply
Anonymous
Information Epoch 1732600405
Silence is golden.
Home
Notebook
Contact us