回车登录页面的问题

$('#txtUserName,#txtpwd').val('');

$('#txtUserName').focus();


$("#txtUserName").bind('keypress', function (event) {
if (event.keyCode == "13") {
if( $("#txtUserName").val())
{
$('#txtpwd').focus();
}

}
});

$("#txtpwd").bind('keypress', function (event) {
if (event.keyCode == "13") {
if($("#txtpwd").val())
{
$('#submitLogin').click();
}

}
});

猜你喜欢

转载自www.cnblogs.com/sexintercourse/p/10401008.html