JSFiddle - React, Tailwind, and code Playground

HTML

<input id="s20" type="text" name="text20" value="0" maxlength="5" />

JavaScript

function sec() {
    if (document.getElementById("s20").value !== "") {
        document.getElementById("s20").value != "0";
    }
    
}