Home  >  Article  >  Web Front-end  >  How to close the current page in html

How to close the current page in html

coldplay.xixi
coldplay.xixiOriginal
2021-04-28 10:33:5412485browse

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.

How to close the current page in html

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).





html中

该实例演示了如何向 body 元素添加 "onbeforeunload" 事件。

关闭当前窗口,按下 F5 或点击以下链接触发 onbeforeunload 事件。

点击调整到菜鸟教程
rrree

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn