I need to disable all keys in input field, this is what I have so far
window.onkeypress = function(event) {
event.preventDefault();
if (event.charCode && (event.charCode < 48 || event.charCode > 57)) {
return false;
}
}
<input type="text" value="1" size="4" max="7" name="people-value" id="adults-value">
Why does the backspace key still work with this code? What other events should I consider using?