title: JS UNDO DOM modification
body: <p>Is it possible to undo last DOM modification?</p>
  
  <p>I've tried to remember state after any change by</p>
  
  <pre><code>undoArray = [ $("#container").clone() ];
  
  //some situation when dom changed and remember state
  undoArray.push( $('#container').clone() );
  </code></pre>
  
  <p>And then, if needed, to restore <code>#container</code> content from this array, but it was loosing all events attached directly to elements.</p>