实例:
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
>
|