How can I do an anchor to my HTML page using Javascript?

Cifru

New member
I would like to add an anchor to my HTML page using Javascript for example to #chapter1. I know this can be done through HTML and I managed to do it, but I would like to do it using Javacript.

I would like that the link for example to #chapter1 would not displayed in the Browser's address bar because it would spoil another javacript back button on the same page, since the back button would only remote the #chapter1 rather than go to my previous page.

Thanks.
 
Back
Top