History forward()Method
History Object
Definition and Usage
The forward() method loads the next URL in the history list.
The effect of calling this method is equivalent to clicking the forward button or calling history.go(1).
Syntax
history.forward()
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the forward() method
Example
Example
Create a forward button on the page:
<!DOCTYPE html>
<html>
<head>
<script>
function goForward(){
window.history.forward()
}
</script>
</head>
<body>
<input type="button" value="Forward" onclick="goForward()">
</body>
</html>
<html>
<head>
<script>
function goForward(){
window.history.forward()
}
</script>
</head>
<body>
<input type="button" value="Forward" onclick="goForward()">
</body>
</html>
The output result of the above example:
Try it yourself »
History Object Other Extensions