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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:16:071225browse

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);
      }

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