Javascript find text on page
<p>I need to run a search and replace on HTML similar to the following... I need to have "Find Next" "Replace" and "Replace All" options.... the trick is that I need to run an AJAX request to update the values in the database for each field once the value is replaced.</p>

<p>The only trouble I'm running into is that I"m unsure exactly how to search the contents of <code>#sheet</code> and replace the values with the new value the user has provided.</p>

<pre><code>&lt;div id='sheet'&gt;
&lt;div class='item' id='field-18583'&gt;This is yet another test&lt;/div&gt;
&lt;div class='item' id='field-18585'&gt;This is test data&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I should say that it's possible I'll have TONS of text to search, so ideally I'd only find the next instance of the item that's being searched for, not all instances.  So when I hit "Find Next", if I"m 3 items in, it'll go to the 4th.</p>

<p>What's the best way in javascript to maintain the indexing on this without storing all found results in a variable and causing lag on the page?</p>
