JSFiddle - React, Tailwind, and code Playground
HTML
<input id="textbox" type="text" />
JavaScript
var firstChar = $('#textbox').val().substr(0, 1);
$( "#textbox" ).change(function() {
alert( firstChar );
});
<input id="textbox" type="text" />
var firstChar = $('#textbox').val().substr(0, 1);
$( "#textbox" ).change(function() {
alert( firstChar );
});