You could use the onkeyup
event instead:
"The
onkeyup
event handler captures the moment at which a previously pressed key is released while focus is on the element to which the onkeyup attribute is applied."
In this case:
<input type="text" onkeyup="checkNumber(document)" id="frm1" autocomplete="off">
Note though, that it's always better to keep your markup (HTML) and scripts (JavaScript) separate.
Instead, you could use addEventListener:
var el = document.getElementById("frm1");
el.addEventListener("keyup", checkNumber, false);