案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function clickButton()
5
  {
6
  document.getElementById('button1').click()
7
  }
8
function alertMsg()
9
  {
10
  alert("Button 1 was clicked!")
11
  }
12
</script>
13
</head>
14
<body onload="clickButton()">
15
16
<form>
17
<input type="button" id="button1" onclick="alertMsg()" value="Button 1" />
18
</form>
19
20
</body>
21
</html>
22