JQuery 1.5 selector error

442 views Asked by At

Since, upgrading to JQuery 1.5, the following selector no longer works:

var selectedTab = $('div.menu > ul > li > a[href=service.html]');

The error message is:

uncaught exception: Syntax error, unrecognized expression: [href=service.html]

Is this a bug in the latest version of JQuery or (much more likely) a dormant bug in my code?

1

There are 1 answers

0
SLaks On BEST ANSWER

You need to quote the value:

$('div.menu > ul > li > a[href="service.html"]')