event.which property for events in jQuery

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:

  • keydown(). When I press a key while inside an element. It includes "special keys" and is Case Insensitive
  • append(). Attaches html code plus text to the selected element.
Comments

PHP Captcha


Interesting Articles