title: How to disable a submit button with vanilla javaScript?
body: <p>I don't want the submit button to be enabled if the default values of the drop-downs are present.</p>
  
  <p><a href="https://i.stack.imgur.com/OV2mM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OV2mM.png" alt="enter image description here"></a></p>
  
  <p>This is the portion of my code which relates to my problem:</p>
  
  <pre><code>  function checkSelect(select) {
      if (select.value == '-- select an option --') submit.disabled = true;
      else submit.disabled = false;
    }
  
    (function() {
      if (checkSelect(starting)) {
        starting.addEventListener('change', function(e) {
          startingEventVal = returnAirPort(e.srcElement.value);
          console.log('startingEventVal', startingEventVal);
        });
      }
      if (checkSelect(destination)) {
        starting.addEventListener('change', function(e) {
          startingEventVal = returnAirPort(e.srcElement.value);
          console.log('startingEventVal', startingEventVal);
        });
      }
    })();
  </code></pre>
  
  <p>And this is all of my code:</p>
  
  <pre><code>(function() {
    var starting = document.getElementById('starting'),
      destination = document.getElementById('destination'),
      submit = document.getElementById('submit'),
      airportNames = Object.keys(IntentMedia.Airports.airport_distances()),
      startingEventVal,
      destinationEventVal;
  
    function appendToUL(ul, element) {
      var optionEL = document.createElement('option');
      optionEL.text = element;
      optionEL.value = element;
      return ul.appendChild(optionEL);
    }
  
    function returnAirPort(airport) {
      return airport;
    }
  
    function checkSelect(select) {
      if (select.value == '-- select an option --') submit.disabled = true;
      else submit.disabled = false;
    }
  
    airportNames.forEach(function(element) {
      appendToUL(starting, element);
      appendToUL(destination, element);
    });
  
    (function() {
      if (checkSelect(starting)) {
        starting.addEventListener('change', function(e) {
          startingEventVal = returnAirPort(e.srcElement.value);
          console.log('startingEventVal', startingEventVal);
        });
      }
      if (checkSelect(destination)) {
        starting.addEventListener('change', function(e) {
          startingEventVal = returnAirPort(e.srcElement.value);
          console.log('startingEventVal', startingEventVal);
        });
      }
    })();
  
    submit.addEventListener('click', function(e) {
      e.preventDefault();
      var distance = IntentMedia.Distances.distance_between_airports(startingEventVal, destinationEventVal);
      console.log('distance', distance);
  
      document.getElementById('feedback').innerHTML = distance;
    });
  })(); 
  </code></pre>
  
  <p>Any help would be appreciated!</p>