History forward()Method

History 对象参考手册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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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>

The output result of the above example:


Try it yourself »


History 对象参考手册History Object Other Extensions