The following is the implementation method:
jQuery(function () {
jQuery('input:text:first').focus( );//Directly locate the first text box of the current page
var $inp = jQuery('input:text');//All text boxes
$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();
jQuery(":input:text:eq(" nxtIdx ")").focus();
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn