Home > Article > Web Front-end > What is alert() in javascript
alert() introduction: The
alert() method is used to display an alert box with a specified message and a Confirm button.
Syntax format:
alert(message)
Note: All major browsers support the alert() method.
(Video tutorial recommendation: js video tutorial)
Example:
Display a warning box
<script> function myFunction(){ alert("你好,我是一个警告框!"); } </script>
The running results are shown in the figure below:
Recommended tutorial: js introductory tutorial
The above is the detailed content of What is alert() in javascript. For more information, please follow other related articles on the PHP Chinese website!