Press any key on the keyboard in the input field to get the Unicode character code and the Unicode key code of the pressed key.

Note: The which and keyCode property does not work on the onkeypress event for non-printable, function keys (like CAPS LOCK, CTRL, ESC, F12, etc.).

onkeypress -

onkeydown -