Enter multiple text boxes, and use the Enter key to find the Tab key. The text box tab
To quickly input all text boxes of the form, we do not need to use the mouse to focus the text box.
Put several text boxes on the html page:
<Div class = "DivInput"> <div> <input id = "Text1" type = "text"/> </div> <input id = "Text2" type = "text"/> </div> <input id = "Text3" type = "text"/> </div> <input id = "Text4 "type =" text "/> </div> <input id =" Text5 "type =" text "/> </div> <input id = "Text6" type = "text"/> </div> Source Code
Pay attention to and understand the following points.
When loading a webpage, focus the first text box,
You also need to monitor the carriage return value:
Var $ txtInput = $ ('input: text'); $ txtInput. first (). focus (); $ txtInput. bind ('keylow', function (e) {if (e. which = 13) {e. preventDefault (); var nxtIdx = $ txtInput. index (this) + 1; $ txtInput. filter (": eq (" + nxtIdx + ")"). focus () ;}}); Souce Code