title: jQuery: passing $(this) to named function event handler
body: <p>I note that it's recommended to <a href="https://stackoverflow.com/questions/182630/jquery-tips-and-tricks/696385#696385">use named functions when binding an event handler to a javascript event</a>. How can I do this when my function needs to be passed the <code>this</code> object?</p>
  
  <p>For example, how would I replace the anonymous function below by directly calling <code>doFancyStuff</code>:</p>
  
  <pre><code>$(document).on('change', 'input.fancy-textbox', function () {
      doFancyStuff($(this));
  });
  
  function doFancyStuff($textbox) {
      // fanciness
  }
  </code></pre>
  
  <p>Extra points if you point out other conventions I might be breaking with the above code.</p>
  
  <hr>
  
  <p>To clarify, I want to call the <code>doFancyStuff()</code> method in my example from multiple places, otherwise yes, I could just do something like this:</p>
  
  <pre><code>$(document).on('change', 'input.fancy-textbox', doFancyStuff);
  
  function doFancyStuff() {
      var $textbox = $(this);
  
      // fanciness
  }
  </code></pre>