JavaScript 学习中的帮助记忆(日积月累)

一、输出信息的命令

(一)alert命令

  HTML DOM alert() 方法

  【解释】alert() 方法用于显示带有一条指定消息和一个 OK 按钮的警告框。

  【语法】alert(message)

      message——要在 window 上弹出的对话框中显示的纯文本(而非 HTML 文本)

  【示例】

 1 <html>
 2 <head>
 3 <script type="text/javascript">
 4 function display_alert()
 5   {
 6   alert("I am an alert box!!")
 7   }
 8 </script>
 9 </head>
10 <body>
11 
12 <input type="button" onclick="display_alert()"
13 value="Display alert box" />
14 
15 </body>
16 </html>
View Code

二、快捷键

猜你喜欢

转载自www.cnblogs.com/yxh2019/p/10743171.html