title: Compare "today" date with input date from form
body: <p><br>
  How do i compare "today" with another date from an input?<br>
  I'm doing something like this, but it won't work, can't figure out what's wrong.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function ControlloGiorniPrenotazione() {
    var today = new Date();
    var date_from = document.getElementById("date_from").value;
  
    if (today &gt;= date_from) {
      document.getElementById("controllo_giorni").innerHTML = "You cannot select today or the days before.";
    }
  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
    &lt;body&gt;
    
      &lt;form&gt;
  
        &lt;input type="date" name="date_from" oninput="ControlloGiorniPrenotazione()"&gt;
        &lt;font color="red"&gt;&lt;span id="controllo_giorni"&gt;&lt;/span&gt;&lt;/font&gt;
  
      &lt;/form&gt;
    
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks for your help!</p>