以下是实现方法:

代码如下:


jQuery(function () {
jQuery('input:text:first').focus();//直接定位到当前页面的第一个文本框
var $inp = jQuery('input:text');//所有文本框
$inp.bind('keydown', function (e) {
var key = e.which;
if (key == 13) {
e.preventDefault();
var nxtIdx = $inp.index(this) + 1;
jQuery(":input:text:eq(" + nxtIdx + ")").focus();
}
});
});

09-14 11:20