Web History API
Web History API
Dark mode
Dark code
HTML CSS JAVASCRIPT SQL PYTHON PHP BOOTSTRAP HOW TO W3.CSS JAVA JQUERY C C++
DOM Collections ADVERTISEMENT
DOM Node Lists
JS Browser BOM
JS Window
JS Screen
JS Location
Web History API
JS History
❮ Previous Next ❯
JS Navigator
JS Popup Alert
JS Timing
JS Cookies
The Web History API provides easy methods to access the windows.history object.
JS Web APIs The window.history object contains the URLs (Web Sites) visited by the user.
Web API Intro
Web Forms API
Web History API
The Web History API is supported in all browsers:
Web Storage API
Web Worker API
Web Fetch API
Web Geolocation API
Yes Yes Yes Yes Yes
<script>
function myFunction() {
window.history.back(); Explore now
}
</script>
COLOR PICKER
Go Back
ADVERTISEMENT
Get certified
by completing
a JavaScript
course today!
school
w3 s
2
CE
02
TI 2
R
FI .
ED
<script>
function myFunction() {
window.history.go(-2);
}
</script>
Go Back 2 Pages
Play Game
❮ Previous Next ❯
ADVERTISEMENT
ADVERTISEMENT
Get Certified »
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid
errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.