title: How to remove HTML Element from variable containing HTML?
body: <p>I have got a jQuery var that contains HTML that I'm appending to a page.</p>
  <p>I need to remove a HTML element before I append it to the page but I can't seem to filter it.</p>
  <p>for example the variable contains;</p>
  <pre><code>&lt;div class=&quot;block1&quot;&gt;&lt;/div&gt;
  &lt;div class=&quot;block2&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>I have tried filtering like this before I append:</p>
  <pre><code>var mydata = $(mydata).filter('.block1');
  </code></pre>
  <p>and</p>
  <pre><code>var mydata = mydata.filter('.block1');
  </code></pre>
  <p>but none of these work. Any suggestions?</p>