Trigger Forward Button of Browser

Date Published: 03/09/2020 Published By: JaiSchool

<!DOCTYPE html>
<html>
<head>
  <title>forward button</title>
</head>
<body>

  <button id="next-btn">Next Page</button>

<script>
  var next_btn=document.getElementById("next-btn");
  next_btn.onclick=function()
  {
    window.history.go(1);
  }
</script>
</body>
</html>

Or using history.forward() method

<!DOCTYPE html>
<html>
<head>
  <title>forward button</title>
</head>
<body>

  <button id="next-btn">Next Page</button>

<script>
  var next_btn=document.getElementById("next-btn");
  next_btn.onclick=function()
  {
    window.history.forward();
  }
</script>
</body>
</html>

Publish A Comment

Leave a Reply

Your email address will not be published. Required fields are marked *