Vege
04-29-2006, 12:22 PM
if i have a string
var string = "dasdsa<h1></h1><h2>big</h2>dsa";
i need to strip all tags away from the string that have no content, in this case <h1></h1>
but can this be done if tag names are unknown and different tags occure?
example
<span></span>
should also be removed becouse it's "empty"
im kinda nood with javascript string comparisons.
var string = "dasdsa<h1></h1><h2>big</h2>dsa";
i need to strip all tags away from the string that have no content, in this case <h1></h1>
but can this be done if tag names are unknown and different tags occure?
example
<span></span>
should also be removed becouse it's "empty"
im kinda nood with javascript string comparisons.