Edit This Code:
<!DOCTYPE html>
<html>
<body>

<button onclick="goBack()">Load the next URL in the history list</button>

<p>Notice that clicking on the button here will not result in any action, because there is no next URL in the history list.</p>

<script>
function goBack() {
    window.history.go(1);
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy