javascript回车登录

function keyEnter(){
	if (event.keyCode == 13){
		check();
	}
}

check为验证登录函数。以上方法支持ie8和chrome。火狐没试。

html代码为:

<label for="password">密码</label><input type="password" id="password" name="user.password" onkeypress="keyEnter();" />
posted @ 2014-06-04 09:26  yuhuhu  阅读(227)  评论(0编辑  收藏  举报