So I've changed the selector to
$('.kv-sidebar [href="#"]')
and it works well now.
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/42734901-syntax-error-with-jquery-versions-1-12-2-2-3?utm_campaign=plugin&utm_content=tracker%2F8187901&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F8187901&utm_medium=issues&utm_source=github).
I've got the following error:
Comment on stackoverflow helped to identify the problem: '#' symbol in a selector should be quoted. http://stackoverflow.com/questions/38415960/why-cant-jquery-3-identify-the-character-in-an-attribute-selector
So I've changed the selector to
$('.kv-sidebar [href="#"]')
and it works well now.