我如何使用document.getElementById(someid).单击标签a

How can I use document.getElementById(someid).onclick for tag a

本文关键字:单击 标签 someid 何使用 document getElementById      更新时间:2023-09-26

我想自动点击某个网站上的链接。


由于网页上的链接不是直接链接,如www.example.com/1.html.

它显示以下链接地址的所有链接我感兴趣的点击

javascript:void(1)


下面是我想要点击

的链接的html代码
<a href="javascript:void(1)" onclick="server_playOn(17,2, 'est', this);">
                     Life OK  
                  </a>

一旦你有了一个链接的引用,你可以使用click方法:

referenceToLink.click();