title: How do I remove empty elements from the dom using jQuery?
body: <p>The WordPress word editor spits out empty <code>&lt;p&gt;</code> tags like this: <code>&lt;p&gt;&amp;nbsp;&lt;/p&gt;</code>.</p>
  
  <p>I would like to target all <code>&lt;p&gt;</code> with <code>&amp;nbsp;</code> in them and remove them. I believe I have to use the <code>contains</code> and <code>remove</code> functions but I am not sure if this code would remove the <code>&lt;p&gt;</code> tags with only <code>&amp;nbsp;</code> in them or remove all <code>&lt;p&gt;</code> tags with <code>&amp;nbsp;</code> in them anywhere.</p>
  
  <pre><code>jQuery('p:contains("&amp;nbsp;")').remove();
  </code></pre>
  
  <p>How would I make this work?</p>