`
woai671
  • 浏览: 29771 次
社区版块
存档分类
最新评论

js文本框获取焦点

    博客分类:
  • JS
阅读更多
登陆页面经常要去文本框获取焦点,可使用如下方法:
<script>
window.onload = function(){
	var oInput = document.getElementById("Loginname");
	oInput.focus();	
	}
</script>

或者
<body onload="document.getElementById('Loginname').focus();">
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics