JSFiddle - React, Tailwind, and code Playground
HTML
<input id="txtResult" type="text" value="gf">
<span id="resultifemptyornot"></span>
JavaScript
$('#txtResult').val($('#txtResult').val() == '') ? $('#resultifemptyornot').html('is empty') : $('#resultifemptyornot').html('not empty');