Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

登陆注册页面按回车发生事件 #10

Open
ct1tc opened this issue Apr 3, 2018 · 2 comments
Open

登陆注册页面按回车发生事件 #10

ct1tc opened this issue Apr 3, 2018 · 2 comments

Comments

@ct1tc
Copy link

ct1tc commented Apr 3, 2018

利用jquery的$(document).keyup(function(event){})当event.keyCode==13时,表示按下回车事件,这是进行ajax进行钱后台交互

@huoji555
Copy link
Owner

huoji555 commented Apr 6, 2018

封装一个登录函数,body标签里添加onkeydown = "function()", 方法里判断当event.keyCode==13时,调用登录函数

@zhangjinxin1227
Copy link

使用jQuery onkeydown键起 判断键入的是否是 13 当时13时 调用该按钮的函数
var code=theEvent.keyCode||theEvent.which;
if(code==13){
$("#login2").click();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants