jQuery event.which Property (original) (raw)

Last Updated : 7 Jul, 2023

The **jQuery **event.which is an inbuilt property in jQuery that is used to return which keyboard key or mouse button was pressed for the event.

**Syntax:

event.which

**Parameter: It does not accept any parameter because it is a property, not a function.

**jQuery examples to show the working of this property:
**Example 1: In the below code, ascii value of the key is displayed.

HTML `

Name :

`

**Output:

**Example 2: In the below code, which mouse button was pressed is displayed.

HTML `

Click anywhere in this box !!!

`

**Output: