event.which. Contains the code of the key or mouse button.
In the following example there is an input in which you can type and see any key of the keyboard. In the lower part you will see the code of the key pressed, if the code is 75 the color of the letter will change to red.
To do this we will use the functions:
Interesting Articles