JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="search">
JavaScript
var str;
$('#search').on('keyup', function(e){
alert($(this).val());
});
<input type="text" id="search">
var str;
$('#search').on('keyup', function(e){
alert($(this).val());
});