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
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.
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:
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!