alert("warning text");" statement; alert() is used to display a message with a specified message and a Alert box for OK button."/> alert("warning text");" statement; alert() is used to display a message with a specified message and a Alert box for OK button.">

Home >Web Front-end >HTML Tutorial >How to pop up an alert box on an html page

How to pop up an alert box on an html page

青灯夜游
青灯夜游Original
2021-06-21 15:34:0824006browse

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>

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)
  • 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!

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