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

实例:

 
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 >

猜你喜欢

转载自www.cnblogs.com/zhen0321/p/12052062.html
今日推荐