'Browser popstate and pushstate

I am working in a project where I need to add dynamic elements on a list. Each element will have an anchor link dynamically from the server. It works fine. But after pressing or going back the page goes back to the previously clicked anchor point. How can I stop that? I need the page to go back to the first state when user goes back.



Solution 1:[1]

The links clicked by the user are recorded by the browser. When the user clicks the browser back button the browser navigates to the previous link in the history. We cannot override this operation.

Incase if u can explain the whole problem I can give you a solution.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mohamed Anas