History back() Method - Javascript Browser Object Model

Javascript examples for Browser Object Model:History

Description

The back() method loads the previous URL in the history.

Parameters

None

Return Value:

No return value

The following code shows how to go back to previous page.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="goBack()">Go Back</button>

<script>
function goBack() {//from w  w  w .j  a  v  a  2s .  co  m
    window.history.back();
}
</script>

</body>
</html>

Related Tutorials