html5 accesskey attribute 3a you may not need javascript to add keyboard shortcuts

Solutions on MaxInterview for html5 accesskey attribute 3a you may not need javascript to add keyboard shortcuts by the best coders in the world

showing results for - "html5 accesskey attribute 3a you may not need javascript to add keyboard shortcuts"
Constanza
28 May 2017
1// Register the key handler 
2document.addEventListener('keyup', function(e){
3    // This would be triggered by pressing CTRL + A
4    if (e.ctrlKey && e.keyCode == 65) {
5        window.location.href = "http://ourcodeworld.com"; 
6    }
7
8    // Or with ALT + A
9    //if (e.altKey && e.keyCode == 65) {
10    //    window.location.href = "http://ourcodeworld.com"; 
11    //}
12}, false);