Example 2

For this example, try typing into the textbox below. You will see an alert that displays the character and the keycode corresponding to the key you pressed.