x1nfly
3/25/2019 - 1:55 PM

监听大写锁定

document.getElementById("passwordInput").onkeypress = function (t) {
    var e = t.keyCode || t.which, i = t.shiftKey || 16 == e || !1
    if (!!(e >= 65 && e <= 90 && !i || e >= 97 && e <= 122 && i)) {
        console.log("Caps lock is open...")
    }
}