JSFiddle - React, Tailwind, and code Playground

by diode

HTML

<input type="text" onkeypress="handleKeyPress(event)" />

JavaScript

handleKeyPress = function(e){

    var key = e.keyCode ? e.keyCode : e.charCode;
    if(key >= 65 && key <=90 && !e.shiftKey){

        alert("CAPS LOCK ON");

    }
    
}