How can I focus the next input once the previous input has reached its maxlength value?
a: b:
let otp = document.querySelector('#otp-screen'); for(let pin of otp.children) { pin.onkeyup = function() { if(pin.nextElementSibling) { pin.nextElementSibling.focus(); } } }