Create a back button on a page:
<button onclick="history.back()">Go Back</button>
The output of the code above will be:
Click on Go Back to see how it works.
(Will only work if a previous page exists in your history list)
The history.back()
method loads the previous URL (page) in the history list.
The history.back()
method only works if a previous page exists.
history.back()
is the same as history.go(-1)
.
history.back()
is the same as clicking "Back" your browser.
history.back()
NONE |
NONE |
history.back()
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!