jQuery newbie: how can I pass arguments to an event handler function?
<p>I'm looking at the example for the "click" event in the jQuery documentation <a href="http://docs.jquery.com/Events/click#fn" rel="nofollow">here</a>. I can refactor the two anonymous functions as follows and it still works:</p>

<pre><code>$(document).ready(function(){
    $("p").hover(hilite, remove_hilite);
  });

  function hilite()
  {
    $(this).addClass("hilite");
  }

  function remove_hilite()
  {
    $(this).removeClass("hilite");
  }
</code></pre>

<p>However, what if I want to pass an argument to <code>hilite</code>? My first guess was that I should use an anonymous function like <a href="http://docs.jquery.com/How%5FjQuery%5FWorks#Right" rel="nofollow">this</a>. However, this does not seem to work, even when I'm using it without arguments:</p>

<pre><code>$("p").hover(
    function()
    {
        hilite();
    }
    ,
    function()
    {
        remove_hilite();
    }
);
</code></pre>

<p>I also tried refactoring as follows, but this did not work either:</p>

<pre><code>$(document).ready(function(){
    $("p").hover(hilite2, remove_hilite);
  });

  function hilite2(){
     return hilite();
  }
</code></pre>

<p>What is the proper way to do this? I feel like I have a big conceptual misunderstanding. In particular, I am unclear about how in my first refactoring, the <code>this</code> object is passed to the <code>hilite</code> function.</p>
