Home >Web Front-end >JS Tutorial >Compatibility testing of keyCode, which and charCode in keyboard events_Basic knowledge

Compatibility testing of keyCode, which and charCode in keyboard events_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 19:18:201300browse

Test results:
Under IE:
>> supports keyCode
>> does not support which and charCode, both values ​​are undefined

Under Firefox:
>> Supports keyCode. Except for function keys, other key values ​​are always 0
>> Supports which and charCode, the values ​​of which are the same

Under Opera:
> > Support keyCode and which, both have the same value
>> CharCode is not supported, the value is undefined


[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn