title: Native JavaScript select onchange this.value undefined
body: <p>I have a select tag that is generated by a php file that I would rather not have to change if it can be avoided.  I also do not have the ability to use jQuery to solve my problem.  So here is how I am trying to set an onchange event:</p>
  
  <pre><code>var d = document.getElementById('lang_choice');
  d.onchange = function(){
      window.alert(this.value);
  }
  </code></pre>
  
  <p>The pop up box just says undefined.  I have checked the html and it has the value attributes set in the option tags.  So I am guessing I misunderstand something about this system and some explanation would be great.</p>