When I open my page at http://www.mywebsite.com/ where I have this jQuery code :
$('#locSlideButton2').click(function() {
});
I’d like, clicking on the locSlideButton2 element, add an hash (such as #example) to the url, without make any redirect.
How can I do it?
Using plain old vanilla JS:
MDN on window.location