Link to home
Start Free TrialLog in
Avatar of bill_home
bill_home

asked on

jquery selector no longer working in version 2.1.0.min

Hello Experts,

This selector worked in 1.7.1. min, now I am getting the following error in Chrome.  Does anyone know why?
 
 $('input:checkbox[@id]').filter(function () {



uncaught Error: Syntax error, unrecognized expression: input:checkbox[@id] jquery-2.1.0.min.js:2
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Are you sure? I usually use # not @ for id

 $('input:checkbox[#id]').filter(function () {

Or it's a typo?
Avatar of bill_home
bill_home

ASKER

no not a typo
it has been that way for a long time. I searched back releases.
Here is the code up to the else statement

 function NodeChecked(currentNode) {
                   var id = currentNode.id;
                   var currentCheckbox = $('#' + id);

                   if (currentCheckbox.is(':checked') == true) {

                       // It's a primary node
                       if (id.indexOf('-') <= 0) {

                           $('input:checkbox[@id]').filter(function() {
                               var regex = new RegExp('^' + id + '-');
                               if ($(this).attr('id').match(regex) !== null) {
                                   $(this).prop('checked', true);
                               }
                           });
                       }

                   } else {
ASKER CERTIFIED SOLUTION
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That was it thanks for the fast response
I'm happy to help you, we have been lucky: I never heard about @ in jquery! ;-)
Every upgrade we find some interesting "changes".  

Thanks Again
Bill