null as input javascript code example
Example 1: if input value is null do something
if(document.getElementById("question").value.length == 0)
{
alert("empty")
}
Example 2: javascript form submit on button click check if required fields not empty
<input type="text" id="checkIt" required />