title: Use Jquery to Reset the Dom and then manipulate it again
body: <p>I would like to reset the DOM to original state and then manipulate it again. </p>
  
  <p>I have found that <a href="https://stackoverflow.com/questions/7671965/how-to-reset-dom-after-manipulation">the best way to do this</a> is as follows:</p>
  
  <pre><code>// Clone the Dom and assign it to a variable
  divClone = $("#document").clone();
  
  // .... More Code ......
  
  // When required, replace the DOM with with the cloned variable. 
         $("#document").replaceWith(divClone);   
  </code></pre>
  
  <p>The only problem is that you cannot manipulate the newly reseted DOM again. </p>
  
  <p>I have put together a <a href="http://jsfiddle.net/big_smile/JCtJh/2/" rel="nofollow noreferrer">JSFiddle</a> which uses a simple example of adding a class.
  You can click on the "test" link to add a a class. You can then click on "Reset" to return the DOM back to its original state.  However, if you click on the "test" link again, no more classes will be added to the restored DOM.
  (Obviously, this is just a simplified example. There are better ways of removing and adding classes). </p>
  
  <p>How can I manipulate the restored DOM?</p>