jquery currying
<p>Please see
<a href="http://stackoverflow.com/questions/1798828/accessing-parameters-and-events-in-function-from-jquery-event">Accessing Parameters *and* Events in function from jQuery Event</a></p>

<p>How can I change this code so <code>$(this)</code> acts like <code>$(this)</code> in a click event instead of returning the complete html document?</p>

<pre><code> &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT"&gt;
&lt;meta http-equiv="Pragma" content="no-cache"&gt;
&lt;meta http-equiv="Cache-Control" content="no-cache"&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;meta http-equiv="content-language" content="en"&gt;
&lt;meta name="author" content=""&gt;
&lt;meta http-equiv="Reply-to" content="@.com"&gt;
&lt;meta name="generator" content="PhpED 5.2"&gt;
&lt;meta name="description" content=""&gt;
&lt;meta name="keywords" content=""&gt;
&lt;meta name="creation-date" content="09/20/2007"&gt;
&lt;meta name="revisit-after" content="15 days"&gt;
&lt;title&gt;Untitled&lt;/title&gt;
&lt;link rel="stylesheet" type="text/css" href="my.css"&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
function functionToCall(clickedItem) {
  return function (ev) {
    // both accessible here
    alert(ev.type);
    console.debug(clickedItem);
    alert(clickedItem.attr('id'));
  }
}


$(document).ready(function() {
   $("a").live("click", functionToCall($(this)));
 });
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;a href='#' id="test"&gt;Test&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
