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