I have keyboard shortcut that executes some jQuery:
$('body').on('keyup', function(e) {
if (e.keyCode == 70) {
$('html').addClass('example');
$('#example').focus();
return false;
}
});
When the user presses f
, it'll execute the jQuery.
How can I change the keyCode
so instead of it being f
, I'd like it to be when the user presses alt + f
?
This is what I tried:
$('body').on('keyup', function(e) {
if (e.keyCode == 18 && 70) {
$('html').addClass('example');
$('#example').focus();
return false;
}
});
But it didn't work.