JSFiddle - React, Tailwind, and code Playground

HTML

<input id='input' type='text' />

JavaScript

document.getElementById('input').onkeypress = function() {
    alert('fired');
}