Easy Tutorial
❮ Dom Obj Hidden Prop Month Disabled ❯

History forward() Method


Definition and Usage

The forward() method loads the next URL in the history list.

Calling this method has the same effect as clicking the forward button or calling history.go(1).

Syntax


Browser Support

All major browsers support the forward() method.


Example

Creating a forward button on a page:

<!DOCTYPE html>
<html>
<head>
<script>
function goForward(){
    window.history.forward()
}
</script>
</head>
<body>

<input type="button" value="Forward" onclick="goForward()">

</body>
</html>

The above example outputs:


❮ Dom Obj Hidden Prop Month Disabled ❯