Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the "@" sign in jQuery selector means?

Tags:

jquery

What does the @ sign in the following code means ?

$("input[@type=checkbox][@checked]").each(
    function() {
        ...
    }
);
like image 637
Misha Moroshko Avatar asked Oct 07 '10 06:10

Misha Moroshko


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.

What does dollar sign ($) means in jQuery?

The $ sign is nothing but an identifier of jQuery() function. Instead of writing jQuery we simply write $ which is the same as jQuery() function.

Which symbol is used in jQuery select?

jQuery selectors are used to "find" (or select) HTML elements based on their name, id, classes, types, attributes, values of attributes and much more. It's based on the existing CSS Selectors, and in addition, it has some own custom selectors. All selectors in jQuery start with the dollar sign and parentheses: $().

What does $() mean in Javascript?

The $() function The dollar function, $(), can be used as shorthand for the getElementById function. To refer to an element in the Document Object Model (DOM) of an HTML page, the usual function identifying an element is: document.


1 Answers

This is an xpath convention for attribute selection, which was discontinued two versions ago.
You should remove the @ sign if you want the selectors to work on the current version.

Alternatively, the selector $("input:checkbox:checked") should work just the same.

like image 196
Kobi Avatar answered Oct 06 '22 19:10

Kobi