KeyboardEvent which Property

Example

Get the value of the pressed keyboard key:

let value = event.which;
Try it Yourself »

Description

Warning !

The which property is deprecated.

Use the key property instead.


Syntax

event.which

Technical Details

Return Value: A Number
The character code
DOM Version: DOM Level 2 Keyboard Events.

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.