javascript: Defining "this" in the context of a function
<p>When jQuery calls a function as an event handler for a raised event, jQuery is somehow able to define "this" in the context of a function that it calls. In the following example, jQuery define this as the dom element that was clicked on.</p>

<pre><code>&lt;input id="someButton" type="button" value="click me!"/&gt;
&lt;script type="text/javascript"&gt;
     $("#someButton").click(EventHandler);
     function EventHandler() 
     {
          alert($(this).attr("id")); //This raises an alert message "someButton"
     }
&lt;/script&gt;
</code></pre>

<p>How does jQuery do this? I would like replicate this behaviour for my own custom framework.</p>
