Trigger Forward Button of Browser

<!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>

Leave a Comment