title: Copy DOM element with its events in variable (jQuery)
body: <p>I wanted to copy DOM element in variable, so I did this:</p>
  
  <blockquote>
    <p>var before=$("#someid").html();</p>
  </blockquote>
  
  <p>Then my script does a bunch of stuff in this "someid" DOM and after that is completed I restored DOM like it was before:</p>
  
  <blockquote>
    <p>$("#someid").html(before);</p>
  </blockquote>
  
  <p>This works ok but the problem is that I had some events in this DOM and those events can not be copied like this... So is there another way to do this?</p>