What is the difference between $ , this and $(this) in javascript fundamentals?
Also I want to know about their usage
What is the difference between $ , this and $(this) in javascript fundamentals?
Also I want to know about their usage
In short (assuming jQuery is included, of course):
$
is a variable of window
containering the jQuery library itself. this
is a variable containing a DOM element. $(this)
casts the element this
to an jQuery object.So basically you can't talk about a difference. The one is the whole library itself and the other is just using the library ...
Another example to be clear:
var $ = function(param) {};
var elem = this;
$ // the library
elem // the element
$(elem); // the usage