KeyboardEvent key Property in JavaScript
KeyboardEvent key Property in JavaScript
The key property is a read-only property and it is used to return the identifier of the key that was pressed when a key event occurred. Identifiers are strings that match keyboard buttons. Its return may be a single character like "b", "C", or multiple characters like "F1", or "Enter".
Syntax:-
Its syntax is:- event.key
Return:-
Its return is:- string containing pressed keyboard button