Home > Web Front-end > JS Tutorial > JS gets the value of any key on the keyboard (example code)_javascript skills

JS gets the value of any key on the keyboard (example code)_javascript skills

WBOY
Release: 2016-05-16 17:16:07
Original
1217 people have browsed it

Without further ado, let’s go directly to the code

Copy the code The code is as follows:

function keyUp() {
if(navigator.appName == "Microsoft Internet Explorer"){
var keycode = event.keyCode; var keycode = keyUp.caller.arguments [0].which;
    }
     alert(keycode);
      }

Related labels:
js
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template