Latest web development tutorials

History back () method

History Object Reference History Object

Definition and Usage

back () method can be loaded in the history list prior to a URL (if it exists).

This method is called the effect is equivalent to clicking the back button or call history.go (-1).

grammar

history.back()


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support back () method


Examples

Examples

Create a back button on the page:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function goBack(){
    window.history.back()
}
</script>
</head>
<body>

<input type="button" value="返回" onclick="goBack()">

</body>
</html>

Examples of the above output:


try it"


History Object Reference History Object