<div>
<span>ABC</span>
<ul>
<li>list</li>
<li>list</li>
<span>ABC</span>
<li>list</li>
<ul>
<span>ABC</span>
</div>
This is myString variable, now i want to remove the span elements from this string? So myString will be:
<div>
<ul>
<li>list</li>
<li>list</li>
<li>list</li>
<ul>
</div>
Thanks
(remove() only works on top level elements)
try:
end() gets the updated string (technically, returns the last selection from the stack, i.e. before find).
demo : http://jsfiddle.net/t2uNr/