How to advance to the next form input when the current input has a value?

前端 未结 10 1426
傲寒
傲寒 2020-11-30 04:08

I am having a form with lots of entries. I would like to change my focus to the next textbox, once I entered the value in the current textbox. and want to continue this proc

10条回答
  •  被撕碎了的回忆
    2020-11-30 04:10

    Needed to emulate the tab functionality a while ago, and now I've released it as a library that uses jquery.

    EmulateTab: A jQuery plugin to emulate tabbing between elements on a page.

    You can see how it works in the demo.

    if (myTextHasBeenFilledWithText) {
      // Tab to the next input after #my-text-input
      $("#my-text-input").emulateTab();
    }
    

提交回复
热议问题