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

How to use JavaScript to implement pop-up warnings

不言
Release: 2018-12-17 17:26:49
Original
6341 people have browsed it

When we browse the web, we may encounter that a certain web page cannot be accessed or is unsafe to access. At this time, a warning dialog box will pop up. So, what can we do with this pop-up dialog box? What about implementation? This article will introduce to you how to use How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings to implement this pop-up warning. Let’s look at the specific content below.

How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings

It is very simple to implement this kind of pop-up warning using How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings. Let’s take a look at the specific example

To use How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings to display the alert , just write the following code

alert('要显示的字符串,值');
Copy after login

The complete code is as follows

<!DOCTYPE html>
<html lang = "ja">
  <head>
    <meta charset = "utf-8">
    <title>How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings</title>
  </head>
  <body>
    <script>
      alert(&#39;警告!!!&#39;);
    </script>
  </body>
</html>
Copy after login

The running effect is as follows: When using the browser to load the file, nothing will be displayed on the browser, but the following will be displayed on the page pop up

How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings

The above is the detailed content of How to use JavaScript to implement pop-up warnings. 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!