title: jQuery Selector, All Spans Within DIV
body: <pre><code> $("#" + mainContent).children("span").replaceWith(function(){ return $(this).text(); });
  </code></pre>
  
  <p>Using the above line of code I can't seem to replace all spans with there text value.</p>
  
  <p>The html looks like</p>
  
  <pre><code>&lt;div id="bla" contenteditable="true"&gt;
  &lt;span&gt; bla finds this one&lt;/span&gt;
      &lt;div&gt;
          &lt;span&gt; doesnt find me &lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How do I select all spans within div "bla" and replace them all?</p>
  
  <p>The replace works just the find doesn't.</p>