Replace text inside an element
<p>I'm needing to replace a portion of text inside arbitrary elements. I won't know anything about the structure of the element, including about any child elements it may have, but I have to assume there may be child elements with attached bindings. An example might be:</p>

<pre><code>&lt;div id="checkit"&gt;
  Lorem ipsum textum checkum.
  &lt;input type="button" id="clickit" value="Click Me" /&gt;
&lt;/div&gt;
</code></pre>

<p>Now, if I want to replace 'ipsum' with something else, I could grab the contents of #checkit with innerHTML, run replace on it, then set its innerHTML with the new text, but if a binding has been set on #clickit, the binding will be lost when innerHTML is updated.</p>

<p>I don't really need or want to replace the entire innerHTML of the element but I'm not sure how else to replace a portion of text in the element.</p>

<p>So my question is twofold:</p>

<ol>
<li>Suggestion on how to replace a portion of text within #checkit</li>
<li>Suggestion on how to replace innerHTML without losing bindings (or a way to save bindings inside #checkit and reapply them after replacing innerHTML)?</li>
</ol>
