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?!
your selector is not valid. # is a special char and needs to be escaped like 'a[href*=\\#]:not([href=\\#])'
Yes, this is another duplicate of gh-2824.
This really helped me. After after a drupal site 8.3.7, the sub-menus no longer displayed. All i did was add the two backslash to the jQuery function.
Most helpful comment
your selector is not valid.
#is a special char and needs to be escaped like'a[href*=\\#]:not([href=\\#])'see https://api.jquery.com/category/selectors/