Since you used onkeyupcode in your example code, it sounds as if you want to call a function every time you press a key. If so, instead of onchange- which fires when it inputloses focus, you should use oninputone that will fire anytime there is a change inside the input.
source
share