Javascript 如何在锚定标记中找到锚定链接,并使用jquery自动单击该链接
如何在锚定标记中找到锚定链接,并在jquery中自动单击该链接 范例Javascript 如何在锚定标记中找到锚定链接,并使用jquery自动单击该链接,javascript,jquery,Javascript,Jquery,如何在锚定标记中找到锚定链接,并在jquery中自动单击该链接 范例 <div id="myid"> <a id="interestingness" href="htttp://mylink.com">mytestinglink</a> </div> 您可以尝试以下方法: $('#interestingness')[0].click(); $(“#趣味性”)。单击()在所有兼容HTML5的浏览器上,您只需使用:趣味性。单击() <div
<div id="myid">
<a id="interestingness" href="htttp://mylink.com">mytestinglink</a>
</div>
您可以尝试以下方法:
$('#interestingness')[0].click();
$(“#趣味性”)。单击()
在所有兼容HTML5的浏览器上,您只需使用:趣味性。单击()代码>
<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'));
});