tags:

views:

62

answers:

1

What does the @ sign in the following code means ?

$("input[@type=checkbox][@checked]").each(
    function() {
        ...
    }
);
+9  A: 

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.

Kobi
Instead of finding that question asked a couple weeks back which this is a dupe of I'm just gonna upvote you since symbols are such a pain to search for anyway :)
BoltClock
Here's a good mnemonic: "@" = "at" => "at-tribute" => "@-tribute"
amphetamachine