JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="myInput" />
JavaScript
var input = document.getElementById('myInput');
if(input.value.length == 0)
input.value = "Empty";
<input type="text" id="myInput" />
var input = document.getElementById('myInput');
if(input.value.length == 0)
input.value = "Empty";