KeyboardEvent charCode Property in JavaScript
KeyboardEvent charCode Property in JavaScript
The charCode property is a read-only property and it is used to return Unicode character code of the key that triggered the onkeypress event. It is actually a number of a character like 98 for "b" character. For converting Unicode values into characters we need fromCharCode() method. Moreover, charCode and keyCode are identical. It will only work with keypress event. Otherwise, it will return value of 0.
Syntax:-
Its syntax is:- event.charCode
Return:-
Its return is:- number which denotes Unicode character code