title: Remove DOM element if it contains a string
body: <p>So I have this code where it checks if the Name exists and if it does it deletes the span tag it's nested in.</p>
  
  <pre><code>&lt;div id="box"&gt;
    &lt;br&gt;
    &lt;span style="font-size: 12px"&gt;
      &lt;a&gt;
        &lt;span style="color: #000000"&gt;
          &lt;b&gt;Name&lt;/b&gt;
        &lt;/span&gt;
      &lt;/a&gt;
    &lt;/span&gt;
  </code></pre>
  
  <p>However name can be also placed in these tags:</p>
  
  <pre><code>  &lt;br&gt;
    &lt;span&gt;
      &lt;a&gt;Name&lt;/a&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How would I use jquery to check it?
  I've tried:</p>
  
  <pre><code>$('span:contains("Name")').remove();
  $('span &gt; a &gt; span b:contains("Name")').remove();
  </code></pre>
  
  <p>Nothing seems to work.</p>
  
  <p>Edit#2: Also there are br tags I just included them. I'd like to remove them only if they're before the removed  tags.</p>
  
  <p>Thanks.</p>