jQuery Replace 1st Instance of text
<p>If I have text like this;</p>

<pre><code>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;this is the real text&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;more&lt;/p&gt;
</code></pre>

<p>What I need is a piece of jQuery that will replace the first instance only of <code>&lt;p&gt;&amp;nbsp;&lt;/p&gt;</code> with ''.</p>

<p>So the result after the call should be;</p>

<pre><code>&lt;p&gt;this is the real text&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;more&lt;/p&gt;
</code></pre>

<p>But if the first line is not <code>&lt;p&gt;&amp;nbsp;&lt;/p&gt;</code> then the call should do nothing.</p>

<p><strong>EDIT</strong></p>

<p>I've tried implementing the solution from @Joey C. but I can't get it to work.  The remove just doesn't.</p>

<pre><code>var myHtml = "&lt;p&gt;abc&lt;/p&gt;&lt;p&gt;next para&lt;/p&gt;";
var newElement = $(myHtml);

if ($(newElement).first("p").text() == "abc") {
    $(newElement).first("p").remove();
}

alert($(myHtml).text());
</code></pre>
