显示警告框
- <!DOCTYPE html>
- <html>
- <body>
- <h1>JavaScript 警告框</h1>
- <button onclick="myFunction()">试一试</button>
- <script>
- function myFunction() {
- alert("我是一个警告框!");
- }
- </script>
- </body>
- </html>
下一篇:演示在警告框中换行
- <!DOCTYPE html>
- <html>
- <body>
- <h1>JavaScript 警告框</h1>
- <button onclick="myFunction()">试一试</button>
- <script>
- function myFunction() {
- alert("我是一个警告框!");
- }
- </script>
- </body>
- </html>
本文档使用 技术池 构建