Answers for "HTML5 Accesskey Attribute: you may not need JavaScript to add Keyboard Shortcuts"

0

HTML5 Accesskey Attribute: you may not need JavaScript to add Keyboard Shortcuts

// Register the key handler 
document.addEventListener('keyup', function(e){
    // This would be triggered by pressing CTRL + A
    if (e.ctrlKey && e.keyCode == 65) {
        window.location.href = "http://ourcodeworld.com"; 
    }

    // Or with ALT + A
    //if (e.altKey && e.keyCode == 65) {
    //    window.location.href = "http://ourcodeworld.com"; 
    //}
}, false);
Posted by: Guest on November-22-2019
0

HTML5 Accesskey Attribute: you may not need JavaScript to add Keyboard Shortcuts

// Register the key handler 
document.addEventListener('keyup', function(e){
    // This would be triggered by pressing CTRL + A
    if (e.ctrlKey && e.keyCode == 65) {
        window.location.href = "http://ourcodeworld.com"; 
    }

    // Or with ALT + A
    //if (e.altKey && e.keyCode == 65) {
    //    window.location.href = "http://ourcodeworld.com"; 
    //}
}, false);
Posted by: Guest on November-22-2019

Code answers related to "HTML5 Accesskey Attribute: you may not need JavaScript to add Keyboard Shortcuts"

Code answers related to "Javascript"

Browse Popular Code Answers by Language