When you follow an anchor link like <a href="#div">, it will go to the element #div and display the CSS style for ":target", example: #div:target { color: red }.
I would like to know how to reproduce this functionality which occurs only when clicking an anchor link (hash).
The whole idea is that I want to custom handle an anchor link so it doesn't trigger the event (on)popstate each time it's clicked. It's very problematic for me that it triggers it.
So if I recode it manually with "scrollIntoView" or the equivalent in Jquery, add its entry to the history (which won't trigger "popstate") then the last thing to code is to trigger the ":target" pseudo-class style.
How to do so?
thank you