form表单中有个focus()方法可以直接锁定input焦点,代码如下:
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
</style>
</head>
<body>
<input type="text" id='input'>
</body>
<script>
document.getElementById("input").focus();
</script>
</html>