Home  >  Article  >  Web Front-end  >  Brief analysis of keyboard event examples in js_javascript skills

Brief analysis of keyboard event examples in js_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:20:591177browse

This article analyzes keyboard events in js with examples. Share it with everyone for your reference. The specific analysis is as follows:

The effect of this example:

Press any key on the keyboard to pop up the corresponding ASCII code, compatible with IE, Chrome and Firefox.

But there are still many problems:

(1) In IE and Chrome, some keys have no effect, such as up, down, left, right, etc.;
(2) The right key and single quote key in Firefox are both 39.

The specific code is as follows:

Copy code The code is as follows:










I hope this article will be helpful to everyone’s JavaScript programming design.

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