Here is my example string...
<span> </span><span class="citation_text" id="_148511159">Rawls, Wilson.
<i>Where the Red Fern Grows: The Story of Two Dogs and a Boy</i>. Garden City, NY: Doubleday, 1961. Print.</span>
I want to remove all text within the <
and >
however keep the ones for <i>
and </i>
.
The closest I have gotten is with this piece of code
string.replace(/<.[^i]+?>/g,"")
however it return this
<span class="citation_text" id="_148511159">Rawls, Wilson.
<i>Where the Red Fern Grows: The Story of Two Dogs and a Boy</i>. Garden City, NY: Doubleday, 1961. Print.
How do I get it to remove the final span that is held in the <
and >
?
Thanks!
UPDATE: This is what I would like the output to be.
Rawls, Wilson. <i>Where the Red Fern Grows:
The Story of Two Dogs and a Boy</i>. Garden City, NY: Doubleday, 1961. Print.