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:22:351366browse
Test results:
Under IE:
>> supports keyCode
>> which and charCode are not supported, 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 :
>> supports keyCode and which, the values ​​of both are the same
>> does not support charCode, 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