JavaScript BOM History Object
BOM - History Object :
We have already talked about the browser object 'window' that gives us access to complete window on which the web page is rendered.
If required, BOM also gives us a specific object to target only one of the window properties. For example, if we are only concerned about the list of URLs that have been visited by the user and we do not need any other information about the browser, BOM gives us the 'history' object for this. It provides programmatic navigation to one of the URLs previously visited by the user. Following are the properties or methods that help us do it
CODE/PROGRAM/EXAMPLE
<html>
<head>
<style>
body {
padding-top: 10px;
}
</style>
</head>
<body class="container-fluid">
<div class="panel panel-primary">
<div class="panel-heading">
<h3>History</h3>
</div>
<div class="panel-body">
<input
type="button"
value="<< Previous"
class="btn btn-warning"
onclick="history.back()"
/>
<input
type="button"
value="Next >>"
class="btn btn-success"
onclick="history.next()"
/>
</div>
</div>
</body>
</html>