JSFiddle - React, Tailwind, and code Playground

HTML

<head>
    <script>
        typedText = "";

        function checkTextChange() {
            if (document.getElementById("test").value != typedText) {
                typedText = document.getElementById("test").value;
                document.getElementById("output").innerHTML = typedText;
                return true;
            } else {
                return false;
            }
        }
    </script>
</head>
<body>
    
<h1>onKeyUp event test</h1>

    <input type="text" name="test" id="test" onkeyup="checkTextChange();">
    <div id="output"></div>
    <hr>
</body>