Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to catch shortcut keys in jquery

$(window).keydown(function (e){
    if ((e.metaKey || e.ctrlKey) && e.keyCode == 83) { /*ctrl+s or command+s*/
        yourFunction();
        e.preventDefault();
        return false;
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #catch #shortcut #keys #jquery
ADD COMMENT
Topic
Name
2+3 =