Reputation: 1
I have two html input[type=number] fields. Each field contain 2 digit numeric velue. After entering 2 digit, I want to move the cursor to the next field automatically. How can I do this with Jquery or javaScript.
Upvotes: 0
Views: 379
Reputation: 1898
You can check length of input of first textbox inside keyup event, then if length equals 2, focus on second input box as.
document.getElementById("id_of_second_textbox").focus();
Upvotes: 1