JavaScript Example (Program)
Learn Details

Window history & Window Propery

Example

HTML Code


   <html>   
   <!--head section-->
   <head>
      <title>Official Website Teach Coders</title>
        <meta name="description" content="Teach Coders" />
        <meta name="keywords" content="Teach Coders" />
   </head>

   <body>
   <button onclick="back_func()">Back</button>
   <button onclick="next_func()">Next</button>
   </body>
</html>
   

Javascript Code


<script>
 function back_func(){
         history.go(-1)
      }

      function next_func(){
         history.go(1)
      }
</script>