JQuery get text start with an element
<p>i have this code.</p>

<pre><code>&lt;p&gt;jQuery is free, open source software, dual-licensed under the &lt;span&gt;MIT License&lt;/span&gt; or the GNU General Public License, Version 2.&lt;/p&gt;
&lt;p&gt;&lt;span id="elt"&gt;jQuery is a&lt;/span&gt; cross-browser &lt;span&gt;JavaScript&lt;/span&gt;library designed to simplify the client-side scripting of HTML. &lt;span&gt;It was released in January 2006&lt;/span&gt; at BarCamp NYC by John Resig. Used by over 52% of the 10,000 most visited websites, jQuery is the most popular JavaScript library in use &lt;span&gt;today&lt;/span&gt;.&lt;/p&gt;
&lt;img src="character1.jpg" height="200"/&gt;
&lt;p&gt;jQuery is free, open source software, dual-licensed under the &lt;span&gt;MIT License&lt;/span&gt; or the GNU General Public License, Version 2.&lt;/p&gt;
&lt;p&gt;...
</code></pre>

<p>i want to get the first 500 characters start with <code>$(".elt")</code> ,like this:</p>

<pre><code>jQuery is a cross-browser JavaScript library designed to simplify the client-side scripting of HTML.It was released in January 2006 at BarCamp NYC by John Resig. Used by over 52% of the 10,000 most visited websites, jQuery is the most popular JavaScript library in use today.jQuery is free, open source software, dual-licensed under the MIT License or the GNU General Public License, Version 2.
</code></pre>

<p>just text, remove all the html tags.</p>
