title: How to get value from onchange?
body: <p>Hi I basically am trying to disable another input field if the day is set to today from another input field (date). I can't seem to force an onchange onto an input field and grab that value into a variable to make this work.</p>
  
  <p>I've had success placing the onchange(this) onto the input field but I have to take it out and force a JS onchange onto it instead.</p>
  
  <p>I've tried the following code. As you can see, it is supposed to do something when the time is past 10am and the date is selected as today:</p>
  
  <pre><code>&lt;script&gt;
      var date = new Date();
      var dd = date.getDate();
      var mm = date.getMonth()+1;
      var yyyy = date.getFullYear();
      var hrs = date.getHours();
  
      if(dd&lt;10) {
          dd='0'+dd
      } 
  
      if(mm&lt;10) {
          mm='0'+mm
      }
  
      date = yyyy+'-'+mm+'-'+dd;
  
  
      var userDateEntry = document.getElementById("fm_deliverydate").onchange().value;
  
      if (hrs &gt;= 10 &amp;&amp; userDateEntry == date) {
          alert("Shipping for today has ended. Your order will arrive tomorrow");
          document.getElementById('fm_deliverytime').disabled= true;
      }
      else{
          document.getElementById('fm_deliverytime').disabled= false;
      }
  &lt;/script&gt;
  
  &lt;input  type="date" name="DateName" id="fm_deliverydate" /&gt;
  
  &lt;input  type="time" name="TimeName" id="fm_deliverytime" /&gt;
  </code></pre>