jquery remove all elements except for first one
Using jquery remove how can i remove all the span tags except for the
first one..
EDIT
var html = var htm =
$("#addin").find(".engagement_data:last-child").find(".keys_values").html();
html='
<span style="display:block;" class="k_v">
<innput type="text" class="e_keys" style="width:65px;"
placeholder="key"/>
<input type="text" class="e_values" style="width:65px;"
placeholder="value"/>
</span>
<span style="display:block;" class="k_v">
<input type="text" class="e_keys" style="width:65px;"
placeholder="key"/>
<input type="text" class="e_values" style="width:65px;"
placeholder="value"/>
</span>
';
$(html).find("span:gt(0)").remove();
No comments:
Post a Comment