title: Simple javascript find and replace
body: <p>is there a straightforward method for searching within a div for a specific string and replacing it with another? I cannot use .replaceWith alone because there are other elements within the div I need to preserve. I've tried various javascript methods found here to no avail.</p>
  
  <p>So something like:</p>
  
  <pre><code>$('#foo').find('this string').replaceWith('this other string');
  </code></pre>
  
  <p>for:</p>
  
  <pre><code>&lt;div id="foo"&gt;&lt;div id="child"&gt;Other Element&lt;/div&gt;this string&lt;/div&gt;
  </code></pre>
  
  <p>Thanks.</p>