How to pop up an alert box on an html page

青灯夜游
Release: 2021-06-21 15:34:08
Original
23983 people have browsed it

In the html page, you can pop up an alert box by adding the statement ""; use alert() Displays an alert box with a specified message and an OK button.

How to pop up an alert box on an html page

The operating environment of this tutorial: windows7 system, HTML5&&javascript version 1.8.5, Dell G3 computer.

html page pop-up warning box

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 

</head>
<body>
<script type="text/javascript">alert("警告文本");</script>

</body>

</html>
Copy after login

Rendering:

How to pop up an alert box on an html page

Description:

alert() method is used to display an alert box with a specified message and an "OK" button.

Alert boxes in websites are used to display a warning message to the user that they have entered an incorrect value that is not the value required to fill in the location. Still, alert boxes can be used for friendlier messages. The alert box only provides a button "OK" to select and continue.

Syntax

alert(message)
Copy after login
  • message: plain text (not HTML text) to be displayed in the pop-up dialog box on the window

For more programming-related knowledge, please visit: Programming Video! !

The above is the detailed content of How to pop up an alert box on an html page. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template