Home  >  Article  >  Web Front-end  >  What is alert() in javascript

What is alert() in javascript

王林
王林Original
2020-04-28 13:23:075273browse

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:

What is alert() in javascript

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!

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