I’ve got four inputs that each take one number. What I want to do is set the focus automatically to the next input once the number has been set. They all have the class “inputs”.
This didn’t quite work:
$(".inputs").keydown(function () {
$(this).next().focus();
});
I would suggest setting maxlength as 1 to each textbox and switch to next one once the
val.lengthand themaxlengthis same.DEMO
Edit: Spent some time for the following (not fully tested, but basic tests worked fine)
Code:
DEMO