title: JqueryInAction Book Example Uses Local Variable Instead of this
body: <p>I am new to Jquery and reading 'JQueryInAction' book. 
  I came across this example from this book:</p>
  
  <pre><code>$(function(){
      $('*').each(function(){
          var current = this;
          this. onclick = function(event) {
              if (!event) event = window.event;
              var target = (event.target) ? event.target : event.srcElement;
              say('For ' + current.tagName + '#'+ current.id +
                  ' target is ' + target.id);
          }
      });
  });
  </code></pre>
  
  <p>Here I really don't understand use of local variable <code>current</code> instead of <code>this</code> at line no 3.</p>
  
  <p>Note: I know JavaScript and I understand <code>closures</code> and how <code>this</code> is not available inside <code>closure</code> But that is not the case here, <code>this</code> is available inside the event handler.
  What is the significance of <code>current</code> here.</p>