Jquery自动对焦第二输入

Jquery自动对焦第二输入,jquery,forms,autofocus,Jquery,Forms,Autofocus,我找到了一种使用jquery在表单中集中下一个输入的方法。但我必须在表单中的每个输入之后添加隐藏的输入。所以这个jquery函数关注下一个隐藏的输入。我如何通过这些隐藏的输入 $(function() { $('#fill1,#fill2,#fill3,#fill4,#fill5,#fill6').keyup(function(e) { if ($(this).val().length == $(this).attr('maxlength')) {

我找到了一种使用jquery在表单中集中下一个输入的方法。但我必须在表单中的每个输入之后添加隐藏的输入。所以这个jquery函数关注下一个隐藏的输入。我如何通过这些隐藏的输入

$(function() {
    $('#fill1,#fill2,#fill3,#fill4,#fill5,#fill6').keyup(function(e) {
        if ($(this).val().length == $(this).attr('maxlength')) {
            $(this).next(':input').focus();
        }
    })
});

通过将下一个函数加倍,可以跳过一个函数,如下所示:

$(this).next(':input').next(':input').focus();

您可以通过将下一个函数加倍来跳过一个函数,如下所示:

$(this).next(':input').next(':input').focus();