Get the text after span element using jquery
<p>I have this html code</p>

<pre><code>&lt;div id="mydiv"&gt;
    &lt;div&gt;
        &lt;span&gt;Text inside span&lt;/span&gt;
        Text next to span
    &lt;/div&gt;
    &lt;div&gt;
        Contents inside the 2nd div element...
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I wanted to get the <strong>"Text next to span"</strong>. I tried this code JQuery code</p>

<pre><code>var a = $('#mydiv div').first().find('span').parent().text();
alert(a);
</code></pre>

<p>The output of the jquery code above is this:</p>

<pre><code>Text inside span
Text next to span
</code></pre>

<p>What should be the right thing to do to just get only the <strong>"Text next to span"</strong>?</p>
