Lets say I want to go to the previous page in Chrome and I click "<-". Can I add an EventListener or some kind of function that activates when I click the button.
function goBack() {
document.getElementsByTagName("body")[0].style.overflow = "auto";
}
So in the example above. I want to call goBack()
function when user goes to previous page that changes body
overflow to auto
.
When I searched how to solve this problem I only found instances on how to move back using history.back()
.