JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="empty" /> 
<input type="text" value="non-empty" id="nonempty" />

JavaScript

alert($('#empty').val());
alert($('#nonempty').val());