如何使用jQuery查找锚点链接并自动点击该链接?

3
如何在jquery中查找锚点链接并自动点击该链接。
示例
<div id="myid">
<a id="interestingness" href="htttp://mylink.com">mytestinglink</a>
</div>

1
在所有符合HTML5标准的浏览器上,您只需使用:interestingness.click(); - undefined
3个回答

2
您可以尝试像这样的方法:
$('#interestingness')[0].click();

1
<div id="myid">
<a id="interestingness" href="htttp://mylink.com" target="_blank">mytestinglink</a>
</div>


$("#interestingness").click(function(){
          var currentAnchor = $(this);
          alert(currentAnchor.text());
          alert(currentAnchor.attr('href'));
        });

-1

$('#interestingness').click();


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接