Home > Article > Web Front-end > How to close the current page in html
html Methods to close the current page: 1. Customize the prompt to close; 2. When the user is about to leave the current page, the user clicks the close button onbeforeunload event in the browser's maximize-minimize close button.
The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.
htmlMethods to close the current page:
1. Customize the prompt to close
2. When you are about to leave the current page (refresh or close) When
The user clicks the close button in the maximize or minimize close button of the browser
The onbeforeunload event is triggered when the current page is about to be left (refreshed or closed).
rrreehtml中 该实例演示了如何向 body 元素添加 "onbeforeunload" 事件。
关闭当前窗口,按下 F5 或点击以下链接触发 onbeforeunload 事件。
点击调整到菜鸟教程
Related learning recommendations: html video tutorial
The above is the detailed content of How to close the current page in html. For more information, please follow other related articles on the PHP Chinese website!