If I have text like this;
<p> </p>
<p>this is the real text</p>
<p> </p>
<p>more</p>
What I need is a piece of jQuery that will replace the first instance only of <p> </p> with ''.
So the result after the call should be;
<p>this is the real text</p>
<p> </p>
<p>more</p>
But if the first line is not <p> </p> then the call should do nothing.
EDIT
I've tried implementing the solution from @Joey C. but I can't get it to work. The remove just doesn't.
var myHtml = "<p>abc</p><p>next para</p>";
var newElement = $(myHtml);
if ($(newElement).first("p").text() == "abc") {
$(newElement).first("p").remove();
}
alert($(myHtml).text());