title: bind this keyword for non-anonymous functions
body: <p>Let say I have the following code</p>
  
  <pre><code>$("p").bind("click", function(){
    alert( $(this).text() );
  });
  </code></pre>
  
  <p>When the user clicks a <code>&lt;p&gt;</code>, an alert show up. What's good here, is that I make use of the "this" keyword.</p>
  
  <p>Now I want to get rid of the anonymous function (using it multiple time per script);</p>
  
  <pre><code>$("p").bind("click", myfunction());
  myfunction(){
    alert( $(this).text() );
  }
  </code></pre>
  
  <p>this now refer to Window. How can i do to fix that?</p>
  
  <p>Update:</p>
  
  <p>A suggested solution by answerers that actually works</p>
  
  <pre><code>$(function(){
      $("p").bind("click", function() { myfunction($(this));});
  
      function myfunction(elem)
      {
        alert( elem.text() );
      }
  });
  </code></pre>
  
  <p>This is good, but you'll finish creating a new function every time that line of code is called, no?</p>