登录页面使用回车切换控件

登录页面效果图

 
	jQuery(function() {
		$("#userName")[0].focus();

		$("#userName").bind('keydown', function(event) {
			if (event.keyCode == 13) {
				$("#password")[0].focus();
			}
		});

		$("#password").bind('keydown', function(event) {
			if (event.keyCode == 13) {
				$("#verifyCode")[0].focus();
			}
		});

		$("#verifyCode").bind('keydown', function(event) {
			if (event.keyCode == 13) {
				$("#btnLogin")[0].focus();
			}
		});

		$("#btnLogin").bind('keydown', function(event) {
			if (event.keyCode == 13) {
				submitForm();
			}
		});
	});
原文地址:https://www.cnblogs.com/Lillian-1304/p/5156730.html