Syntax error, unrecognized expression: a[href*=#]:not([href=#])

I have used $('a[href*=#]:not([href=#])') selectior somewhere in my code like this:

$('a[href*=#]:not([href=#])').click(function () {
    console.log("Hello World");
})

It has worked without any issue with jQuery v2.1.4 and jQuery migrate v1.2.1, but I get this error message when I try to use jQuery 2.2.0 and jQuery migrate 1.3.0:

Error: Syntax error, unrecognized expression: a[href*=#]:not([href=#])
jquery-2.2.0.js:1463:8

I’m using Firefox v44.0

Any Suggestion?!

Author: Fantashit

2 thoughts on “Syntax error, unrecognized expression: a[href*=#]:not([href=#])

Comments are closed.