title: javascript - get selected value from select list
body: <p>i got a form with a select form elements for month.</p>
  
  <pre><code>&lt;select id="month" name="month"&gt;
  &lt;option value="Jan"&gt;Jan&lt;/option&gt;
  &lt;option value="Feb"&gt;Feb&lt;/option&gt;
  &lt;option&gt;Mar
  &lt;option&gt;Apr
  &lt;option&gt;May
  &lt;option&gt;Jun
  &lt;option&gt;Jul
  &lt;option&gt;Aug
  &lt;option&gt;Sept
  &lt;option&gt;Oct
  &lt;option&gt;Nov
  &lt;option&gt;Dec
  &lt;/select&gt;
  </code></pre>
  
  <p>How do i use javascript to get compare the selected value. for example if i select Feb, the javascript will pop up "you selected feb"</p>
  
  <pre><code>var monthSelect = document.getElementById("month")
  var opt = monthSelect.options[monthSelect.selectedIndex]
  if(opt.text == "Feb")
  {
      alert("Feb selected")
      return false
  }
  </code></pre>