[JavaScript/jQuery] JavaScript로 Caps Lock 체크
JavaScript에서 Caps Lock을 체크하는 방법이다. $("#memberPwd").on("keypress", function(e) { var text = String.fromCharCode( e.which ); if ( text.toUpperCase() === text && text.toLowerCase() !== text && !e.shiftKey ) { alert("Caps Lock이 켜져있습니다."); } });
Development/JavaScript
2020. 8. 26. 21:14