How to beat JS error Uncaught Error: Syntax error, unrecognized expression: .main_menu .menu li > a[href*=#] ? Appears in the jquery.js file on this page and on the whole site .

  • It is worth starting with a search in html and js files of the place where this selector is used. When you find it, try changing it to .main_menu .menu li > a[href*="#"] . - Sergey Gornostaev

1 answer 1

Invalid attribute selector syntax for <a> tags: the correct format should be [атрибут="значение"] { Описание правил стиля } - therefore, in the selector there are no quotes in which the value should be indicated.

a[href*="#"] - right

a[href*=#] - wrong

More details can be found at the link: Attribute selectors