When I add below script and run. I am getting this:
Uncaught Error: Syntax error, unrecognized expression: ul li a[href=#!id1]
I tried the solution provided by
https://github.com/jquery/jquery/issues/2885
which worked for me. I search for [href=#] in js and replace with [href*=\\#]
[href=#] in js and replace with [href*=\\#]
a[href*=\\#]:not([href=\\#])