如何触发 JavaScript 点击事件?
要触发 JavaScript 点击事件,我们来举一个鼠标悬停的例子。
例子
<!DOCTYPE html>
<html>
<body>
<p>Hover over the button.</p>
<form>
<input type="button" id="test" value="Hover" onmouseover="display()" onclick="alert('click event')">
</form>
<script>
function display() {
document.getElementById("test").click();
}
</script>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP