<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Document</title>
<script type="text/javascript">
window.onload = function(){
var txt = document.getElementById("txt");
txt.focus();
}
</script>
</head>
<body>
<form action="demo.php">
<input type="text" id="txt" />
<input type="submit" />
</form>
</body>
</html>
js自动获得焦点
最新推荐文章于 2024-01-26 20:24:09 发布