title: Replacing elements in html string
body: <p>Problem: I am trying to replace elements of a certain class with an empty string.</p>
  
  <p>What i've tried</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
           &lt;td&gt;Cell to keep&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class='hide-report-item'&gt;
          &lt;td&gt;Remove Me&lt;/td&gt;
       &lt;tr&gt;
  &lt;/table&gt;
  
  &lt;script&gt;
  &lt;!-- In my scenario data is actually a partial coming back from an ajax call) --&gt;
  function ParseData(data)
  {
                  var foo = $(data)[2];
                  var hideItems = $(foo).find('.hide-report-item');
  
                  hideItems.each(function () {
                      var test = $(this)[0];
                      data = data.replace(test.outerHTML, '');
                  });
  }
  &lt;!-- Ive also tried different variations of this --&gt;
  function ParseData(data)
  {
                  var foo = $(data).find('.hide-report-item').hide();
                  var hideItems = $(foo).html();
  }
  
  &lt;script&gt;
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
           &lt;td&gt;Cell to keep&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Any help would be appreciated. thanks</p>