Using the closure scope to keep the last value
<p>I have the following:</p>

<pre><code>$('th').click(function() {
   var $th = $(this);
   ...
});
</code></pre>

<p>Using the closure scope, I want to say:</p>

<pre><code>var $th;
$('th').click(function() {
   if ($th !== $(this)) {
      $th = $(this);
      ...
   }
});
</code></pre>

<p>Note: This code is just prior to &lt;/body>, so I won't need $(function() {});</p>
