x
 
<!DOCTYPE html>
<html>
<body>
<h1>Element 对象</h1>
<h2>click() 方法</h2>
<p>将鼠标悬停在复选框上可模拟鼠标单击。</p>
<form>
  <input type="checkbox" id="myCheck" onmouseover="myFunction()">
</form>
<script>
function myFunction() {
  document.getElementById("myCheck").click();
}
</script>
</body>
</html>