JavaScript event triggering a tag

Click document the call () method, the following specific examples:


html

<a id="a" href="www.baidu.com"></a>

js

var link = document.getElementById('a');
//调用document的click()方法即可
link.click();
Published 204 original articles · won praise 59 · Views 140,000 +

Guess you like

Origin blog.csdn.net/baidu_34122324/article/details/102524951
Recommended