实例:
|
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<html> <head> <title>网页打开后,id为target的元素就被点击了</title> </head> <script> function load(){ document.getElementById("target").click(); } </script> <body onload="load()"> <button id="target" onclick="test()">test</button> </body> <html> |
原文:https://www.cnblogs.com/zhen0321/p/12052062.html