close
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<label for="username">方法一:按我直接去focus那個input</label>
<br><br><br>
<input type="text" id="username">
<br><br><br>
<p id="p">方法二:按我直接去focus那個input</p>
<br><br><br>
<input type="password" id="password">
<script type="text/javascript">
document.getElementById('p').onclick=function(){
document.getElementById('password').focus();
}
</script>
</body>
</html>
全站熱搜
留言列表