KeyboardEvent keyCode

Example

Get the value of the pressed keyboard key:

let value = event.keyCode;
Try it Yourself »

Description

Warning !

The keyCode property is deprecated.

Use the key property instead.

Syntax

event.keyCode

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.