javascript - Append additional html to cloned object in jquery -


i want add additional html in cloned object.

var item = $("#clone")     .clone(true, true)     .attr({"id": "citem", "class": "row cartitem_" + item_id})     .css('display', 'block')     .appendto("#all-items"); 

i know wrap method else. want append html after cloned object. or somehow can manipulate html of cloned object element.

assuming trying add html after clone:

$("#toclone")     .clone()     .attr({"id":"cloned"})     .appendto("#all-items")     .after("<div>some more content <em>after</em> clone</div>"); 

the .appendto() returns element appended, can manipulate required, eg using .after()


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -