Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the @ character do in jQuery?

On the selectors page, it says @ is one of the meta-characters. But what does it do?

like image 328
mpen Avatar asked Sep 25 '10 16:09

mpen


People also ask

What does the $() mean in jQuery?

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.

What is a character in JavaScript?

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).

What does $() short and stand for in jQuery?

$ is a short form of jQuery function. $() = jQuery() = window. $() = window. jQuery() $()/jQuery() is a selector function that selects DOM elements.

What is the use of symbol in jQuery?

$ 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.


1 Answers

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.

like image 169
Nick Craver Avatar answered Oct 02 '22 21:10

Nick Craver