I've been confused on the difference between this and $(this). Looking into it, I found this succinct explanation which has worked for me for a while, but then I ran into the following in this tutorial:
$.fn.greenify = function() {
this.css( "color", "green" );
return this;
}
The tutorial explains: "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()"
Unfortunately, I don't entirely follow. I'm confused how you can use a JQuery method on a DOM object rather than on the JQuery wrapper for that DOM object. Any explanation anyone may have would be very helpful.
CLARIFICATION: my interest isn't so much the difference between this and $(this) -- I understand that the former belongs to JavaScript and (roughly speaking) refers to the global object, containing object, or calling DOm element, depending on circumstances, while the latter (again, generally speaking) refers to the JQuery-wrapped element being acted upon. I'm interested in why this.css() works in the above context.
The response I upvoted (apologies, I can't see the respondent's name from the edit screen) addressed that question pretty well, although I'm holding off on accepting that as the answer to gather more viewpoints.