JSFiddle - React, Tailwind, and code Playground
HTML
<input id='input' type='text' />
JavaScript
document.getElementById('input').onkeypress = function() {
alert('fired');
}
<input id='input' type='text' />
document.getElementById('input').onkeypress = function() {
alert('fired');
}