使用jquery将光标从输入框移动

发布于 2024-09-09 09:53:35 字数 160 浏览 0 评论 0原文

我正在尝试做某事,但我不确定它叫什么或者我应该寻找什么。

我想用 jquery 来做。

基本上,当您在输入框中时,如果用户输入一个字符,我希望插入符号自动跳转到下一个输入框。银行一般都有。

这是什么课程或者我应该寻找什么?

感谢您的任何帮助。

I'm trying to do something but I'm not sure what it's called or what I should be looking for.

I want to do it in jquery.

Basically when you're in an input box, if the user enters a character I want the caret to automatically jump to the next input box. Banks usually have it.

What class does this or what should I be looking for?

Thanks for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

是你 2024-09-16 09:53:35

输入第 5 个字符后转到下一个输入框:

$('#in1').keyup(function() {
    if ($('#in1').val().length > 4) {
        $('#in2').focus();
    }
});

Go to next input box after 5th character is entered:

$('#in1').keyup(function() {
    if ($('#in1').val().length > 4) {
        $('#in2').focus();
    }
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文