title: Store value of $(this) in jQuery variable
body: <p>I can't figure out how to store the value of <code>$(this)</code> in a variable for use in another function. </p>
  
  <p>In this example I want a reference to the clicked <code>div</code> element:</p>
  
  <pre><code>function doSomething(thisVar) {
   // do stuff with thisVar
  }
  
  $("div.someClass").click(function() {
      var myThisVariable = $(this);
      doSomething(myThisVariable);
  });
  </code></pre>
  
  <p>It doesn't work (becomes a NULL reference). What is the proper jQuery syntax?</p>
  
  <p><strong>Edit:</strong> This error was down to me confusing different instances of <code>this</code>. It serves to show that you need to pay extra attention to what <code>this</code> really means in each context.</p>