I've written a jQuery function which I intended to check when shift key is pressed specifically when a certain element has focus.
Below is the code I have written
$(document).keyup(function (e) {
if (e.which === 9 && e.shiftKey) {
if ($(".focus > a").focus) {
alert("test");
}
}
});
However, the alert seems to function when shift key is pressed regardless of whether or not .focus >
a has focus. Have I made an error here or is this a bug?