What is the diffrence between them? Which is better?
$
is an alias for jQuery
, neither is "better" really, jQuery
is provided in case something else is using $
, like Prototype (or jQuery.noConflict()
was called for another reason...).
I prefer $
for brevity because I know it refers to jQuery
, if you're unsure (like when writing a plugin) use jQuery
for your primary reference, for example:
(function($) {
//inside here $ means jQuery
})(jQuery);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With