alert() 函数在 JavaScript 中并不常用,但它对于代码测试非常方便。

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
    
<h1>我的第一个 JavaScript</h1>
<p>
JavaScript 能够对事件作出反应。比如对按钮的点击:
</p>
<button type="button" onclick="alert('欢迎!')">点我!</button>
    
</body>
</html>

 

JavaScript - alert()函数

 

相关文章:

  • 2021-11-11
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2021-05-29
  • 2021-11-14
猜你喜欢
  • 2021-11-04
  • 2021-11-14
  • 2021-11-14
  • 2021-11-24
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案