On the selectors page, it says @
is one of the meta-characters. But what does it do?
In jQuery, the $ sign is just an alias to jQuery() , then an alias for a function. This page reports: Basic syntax is: $(selector).action() A dollar sign to define jQuery. A (selector) to "query (or find)" HTML elements.
A JavaScript identifier usually starts with a letter, underscore ( _ ), or dollar sign ( $ ). Subsequent characters can also be digits ( 0 – 9 ). Because JavaScript is case sensitive, letters include the characters A through Z (uppercase) as well as a through z (lowercase).
$ is a short form of jQuery function. $() = jQuery() = window. $() = window. jQuery() $()/jQuery() is a selector function that selects DOM elements.
$ sign is just a valid javascript identifier which is used as an alias for jQuery. Prototype, jQuery, and most javascript libraries use the $ as the primary base object (or function). Most of them also have a way to relinquish the $ so that it can be used with another library that uses it.
It used to be used in the attribute selectors, but that's no longer the case as of jQuery 1.3+. From the attribute selector docs:
Note: In jQuery 1.3
[@attr]
style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the“@”
symbol from your selectors in order to make them work again.
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