JSFiddle - React, Tailwind, and code Playground

by hatefull

HTML

<input id="txtChar" type="text" name="txtChar">

JavaScript

$(document).ready(function(){
$('#txtChar').keydown(function(e){
if (e.keyCode == 32) { 
alert('space')
}
});
});