title: "this" in object methods vs "this" in event handlers
body: <p><strong>Edit</strong><br>
  The answers pointed out that keyword <code>this</code> is used in jQuery just as in any JavaScript code. That is, an object method receives the object itself as <code>this</code>, this is what happens with <code>$.fn</code> functions (they are called on jQuery objects). Event handler functions are callback functions, they are not object methods, and it is the caller that decides what <code>this</code> will refer to inside the function. It normally references a DOM element.</p>
  
  <p><strong>Original question</strong></p>
  
  <p>The differece between <code>this</code> and <code>$(this)</code> is often explained as <code>this</code> references a <strong>DOM object</strong>, while <code>$(this)</code> references a <strong>jQuery object</strong> (a DOM element with a jQuery wrapper around it).<br>
  In the following example, the handler function is passed <code>this</code> as a DOM element, and by wrapping it in <code>$()</code> we make a jQuery object from it, thus we can use on it the functions living in the <code>$.fn</code> namespace.</p>
  
  <pre><code>$('div').on('click', function(event){
      event.preventDefault();
      $(this).css('backgroundColor', 'red');
  });
  </code></pre>
  
  <p><br>
  However, I have just come across this explanation on learn.jquery.com:</p>
  
  <p><strong><a href="http://learn.jquery.com/plugins/basic-plugin-creation/" rel="nofollow" title="Plugins | jQuery learning center">Plugins | jQuery learning center</a></strong></p>
  
  <pre><code>$.fn.greenify = function() {
  this.css( "color", "green" );
  };
  $("a").greenify(); // makes all the links green
  
  // Explanation provided by the author of the article:
  // "Notice that to use css(), another method, we use this, not $( this ).
  //  This is because our greenify function is a part of the same object as css()." 
  </code></pre>
  
  <p><br>
  Does it mean that <code>this</code> references a DOM object when passed to an event handler function, but refers to a jQuery object when passed into a jQuery object method?<br>
  In fact, it makes sense, since the method is called on a jQuery object, thus it is logical to pass it a jQuery object.</p>