title: onchange not working on calculator
body: <p>Here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
      &lt;html&gt;
  
      &lt;head&gt;
         &lt;meta charset="utf-8" /&gt;
         &lt;title&gt;Calculate your MPG&lt;/title&gt;
  
         &lt;script type="text/javascript"&gt;
            function calcMPG() {
               var startMiles = parseInt(document.getElementByID('start').value);
               var endMiles = parseInt(document.getElementByID('end').value);
               var gallons = parseInt(document.getElementByID('gallons').value);
               var mpg = 0;
               if (isNaN(startMiles) || isNaN(endMiles) || isNaN(gallons)) {
                  alert("Please enter numeric values!");
               } elseif (gallons === 0) {
                  alert("Cannot enter 0 gallons!");
               } else {
                  mpg = (endMiles - startMiles) / gallons;
                  document.getElementByID("miles").value = mpg.toString();
               }
            }
         &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt; 
  
         &lt;h2&gt;Enter your starting mileage, ending mileage, and gallons used to calculate your miles per gallon.&lt;/h2&gt;
  
         &lt;form name="calcmpg" action="calcMPG()"&gt;
            Starting Mileage:&lt;br /&gt;
            &lt;input type="text" id="start" value="0" required="required" onchange="calcMPG()" /&gt;&lt;br /&gt;
  
            Ending Mileage: &lt;br /&gt;
            &lt;input type="text" id="end" value="0" required="required" onchange="calcMPG()" /&gt;&lt;br /&gt;
  
            Gallons Used: &lt;br /&gt;
            &lt;input type="text" id="gallons" value="10" required="required" onchange="calcMPG()" /&gt;&lt;br /&gt;&lt;br /&gt;
  
            MPG: &lt;br /&gt;
            &lt;input type="text" id="miles" /&gt;&lt;br /&gt;&lt;br /&gt;
  
            &lt;input type="reset" value="Clear Fields" /&gt; &lt;br /&gt;&lt;br /&gt; 
        
         &lt;/form&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>It is passing validation at W3Schools but it won't calculate the MPG or give the alert if numbers are not entered. I have tried pretty much everything I can think of and I am at my wit's end. I think it is not even calling the Javascript function.</p>