x
 
<!DOCTYPE html>
<html>
<body>
复选框:<input type="checkbox" id="myCheck" autofocus>
<p>单击“试一试”按钮可以查看复选框是否在页面加载时自动获得焦点。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myCheck").autofocus;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>