1

I am trying to disable the browser back button via JS code and have already seen lot of answers like How can I stop the browser back button using JavaScript? and Trying to disable the browser's back button

But my problem is unique, The issue is that once my page is loaded and I don't click inside the document (Anywhere on the page) my browser back button still function the way it use to.

But If I click inside the document/page, all the above scripts and code works properly.

So the I want to ask that if there is any way I can make the document(page) active somehow so that if the user click directly on back button without clicking inside the page, They should not go back.

Faran Khan
  • 1,495
  • 4
  • 14
  • 26

0 Answers0