Prevent backspace in input text box
问题 I'm making a Web application that tests typing speeds. It gives the user some text to type, and an input box to type into. If the user types a wrong key, I'm using preventDefault on the produced key event to prevent the wrong character from being entered into the input box (I instead show the user an error message). The problem is, preventDefault doesn't prevent backspaces from being entered. Ideally, since wrong keys presses will never be entered into the text box, it doesn't make sense to