title: My onClick event is not setting "selectedValue" variable from user selected option?
body: <p>I have a drop down box that is populated with city names. When the user clicks on/selects one of those city names, the value (or option) they clicked on gets set as the variable "selectedValue". It seems like my onClick event is not working properly, although i'm unsure of exactly what is going wrong.</p>
  
  <pre><code>    var selectValues = new Array(["Auckland"],["Christchurch"],["Dunedin"],["Hamilton"],["Tauranga"],["Wellington"],["Nelson"]);
      console.log("Pre-set select menu towns: " + selectValues);
  
      //creates _dropList as a select menu object with an ID and Class Name
      var _dropList = document.createElement("select"); {
          _dropList.id = "selectmenu";
          _dropList.className = "selectmenu";
      }
  
      //loops through the array "selectValues" and adds each value (town name) to the selectmenu as an option
      for ( var i = 0; i &lt; selectValues.length; i++ ) {
          //creates a variable "_options"
          var _options = document.createElement("option");
          //"_options" is equal to the values of "selectValues" ("selectValues" values are added to the select menu)
          _options.value = selectValues[i];
          //debugging
          console.log("Select Menu Options: " + _options.value +" - Array Value: " + i);
  
          _options.innerHTML = selectValues[i];
          //appends the "selectValues" values (which are now equal to "_options" to the select menu)
          _dropList.appendChild(_options);
          //on click of the select menu option...
          _options.onClick = function() {
              //checks the value of the select menu and then 
              var check = _dropList.selectedIndex;
              //make a variable called "selectedValue" and assign it the value of the users chosen option
              var selectedValue = selectValues[check];
              //sends the value of "selectedValue" to the _checkNewTown function
              _checkNewTown(selectedValue);
  
          }
  
      }
  </code></pre>