The forward()
method loads the next URL in the history list.
forward |
Yes | Yes | Yes | Yes | Yes |
history.forward()
None.
No return value.
The following code shows how to create a forward button on a page.
<!DOCTYPE html>
<html>
<head>
<script>
function goForward() {<!-- w w w. j a v a 2 s. c o m-->
window.history.forward()
}
</script>
</head>
<body>
<button onclick="goForward()">Go Forward</button>
</body>
</html>
The code above is rendered as follows: