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.
Its syntax is:- event.charCode
Its return is:- number which denotes Unicode character code