Input with normal handling of Backspace

Enter any value in the input shown below and then press the Backspace key. The key will operate as normal - remove the last character from the input.




Input with manual handling of Backspace

Enter any value in the input shown below and then press the Backspace key. The key's default action, that is to delete the last character from the input, is prevented by the method preventDefault(), and instead an alert is shown.