title: How to use jQuery on-page HTML stored in the object?
body: <p>I am trying to get page HTML by .html() and store it in variable contents. I want to perform some operations on this HTML like removing scroll bars before sending it to a method that prints it.</p>
  
  <p>I have tried using the replace method to remove overflow properties by replacing them with a blank on the HTML object, but I am not sure whether it is the right way to do it. I was wondering if I can use a jQuery function on this HTML and use .css to remove the styles of some divs.</p>
  
  <pre><code>var contents = divToPrint.html();
  </code></pre>
  
  <p>I want to do something like this if its possible:</p>
  
  <pre><code>$(contents).find(span).css('overflow: hidden auto;', '')
  </code></pre>
  
  <p>instead of using following code:</p>
  
  <pre><code>contents = contents.replace('overflow: hidden auto;', '')
  contents = contents.replace('overflow-y: auto;', '')
  contents = contents.replace('-ms-overflow-x: hidden;', '')
  contents = contents.replace('-ms-overflow-y: auto;', '')
  </code></pre>