title: How to get selected value from dropdown in Javascript
body: <p>Now, before you tell me that this is an over-asked question, I already tried looking at multiple versions of this question, and when I tried their solutions, none of them work for me. So I'm going to try to get direct help.</p>
  
  <p>Anyways, I have a dropdown list that contains U.S states that each correspond to an energy cost. I am trying to make it so that when the user selects a state, the Javascript code detects the change, finds the value of the selected option, and sets a variable (declared in a switch statement) based upon that selection.</p>
  
  <p>However, the problem is, no matter what I do, it does not work. I don't know if I'm misspelling something, or I need to write a certain thing that I don't know about, but no matter what I'm doing wrong, it does not work.</p>
  
  <p>Here's the HTML:</p>
  
  <pre><code>&lt;div class="question"&gt;
        &lt;p&gt;&lt;b&gt;In which U.S. state are you currently living in?&lt;/b&gt;&lt;/p&gt;
        &lt;select id="stateselect"&gt;
          &lt;option value="choose" selected="selected"&gt;[none]&lt;/option&gt;
          &lt;option value="al"&gt;Alabama&lt;/option&gt;
          &lt;option value="ak"&gt;Alaska&lt;/option&gt;
          &lt;option value="az"&gt;Arizona&lt;/option&gt;
          &lt;option value="ar"&gt;Arkansas&lt;/option&gt;
          /* Removed most of the options for sake of space*/
        &lt;/select&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>And the Javascript:</p>
  
  <pre><code>var energyCost;
  var state = document.GetElementById('stateselect');
  function getEnergyCost() {
    switch (state.value) {
      case 'choose':
        energyCost = 0.00;
        break;
      case 'al':
        energyCost = 0.13;
        break;
      case 'ak':
        energyCost = 0.21;
        break;
      case 'az':
        energyCost = 0.12;
        break;
      case 'ar':
        energyCost = 0.10;
        break;
     /* Ditto */
    }
  }
  state.addEventListener('change', getEnergyCost, false);
  </code></pre>
  
  <p>Would someone mind giving me some assistance with this? Thanks!</p>
  
  <p>Note: I need the answers in plain Javascript, not jQuery.</p>