//功能:将回车键转tab键
$(function () {
$('input:text:first').focus();
var $enter = $("input[type=text],button[type='button'],select,textarea");
$enter .bind('keydown', function (e) {
var key = e.which;
if (key == 13) {
e.preventDefault();
var nextId = $enter.index(this) + 1;
$enter .eq(nextId).focus();
}
});
网友评论