📌  相关文章
📜  检查一个元素是否在其按键被按下时聚焦 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:30.836000             🧑  作者: Mango

代码示例1
$(window).keyup(function (e) {
    var code = (e.keyCode ? e.keyCode : e.which);
    if (code == 9 && $('#detect:focus').length) {
        alert('I was tabbed!');
    }
});