Home > Web Front-end > JS Tutorial > body text

What is alert() in javascript

王林
Release: 2020-04-28 13:23:07
Original
5288 people have browsed it

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)
Copy after login

Note: All major browsers support the alert() method.

(Video tutorial recommendation: js video tutorial)

Example:

Display a warning box

<script>
function myFunction(){
    alert("你好,我是一个警告框!");
}
</script>
Copy after login

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!