你是小猪猪嘛

跳转页面后自动触发一个点击事件

实例:

 
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>

posted on 2019-12-16 23:19  你是小猪猪嘛  阅读(857)  评论(0)    收藏  举报

导航