Home / Javascript / @ selector is deprected in jQuery, removed in jQuery 1.3

@ selector is deprected in jQuery, removed in jQuery 1.3

In my how to check and uncheck a checkbox with jQuery and how to get and set form element values with jQuery posts I used @name= selectors for some of the form elements but have since discovered the use of the @ was already deprecated and has been removed in jQuery 1.3.

One of my previous examples looked like this, to work out if a checkbox was checked:

$('input[@name=foo]').is(':checked')
$('input[@name=foo]').attr('checked')

To make the code valid for jQuery 1.3 you need to remove the @ symbols and do this instead:

$('input[name=foo]').is(':checked')
$('input[name=foo]').attr('checked')

The use of these selectors without the @ also works in the jQuery 1.2 branch. I am not sure if it works in older versions.