title: Error message does not appear if input value is just blank space
body: <p>If <code>input</code> value is empty my JS function returns <code>false</code> when I click on <code>submit</code> button. However if <code>input</code> is just blank space <code>"    "</code> it's still returning <code>false</code> but the error message and <code>input text border color</code> do not showing up like they do when input value is empty <code>""</code>.  </p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form&gt;
    &lt;input id="textbox" type="text" required/&gt;
    &lt;input type="submit" id="btnSubmit" value="Save" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>JavaScript</strong></p>
  
  <pre><code>var input = document.getElementById("textbox").value.trim();
  
  if (input.length == 0) {
  
      return false;
  }
  </code></pre>