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
Post a Comment