title: DropDown List SelectedIndex is not working with getElementById in javascript
body: <p>I have a DropDown list named as batches.
  If I selected 2nd option,dropdown.selectedIndex inside the OnChange function always shows the selected index.
  But document.getElementById("batches").selectedIndex always shows the 1st index.
  <br/>Why is this? <br/>Actually I want read the correct selectedIndex of batches in another function that's why I need a way to get the correct selected index in both ways.</p>
  
  <pre><code>function OnChange(dropdown){
     var myindex  = dropdown.selectedIndex;// This prints correctly
     alert("Index : "+document.getElementById("batches").selectedIndex);// This is always 0 no metter what selects        
  }
  
  &lt;select name='batches' id='batches' onchange='OnChange(this);'&gt;
  &lt;option value = "1"&gt;1&lt;/option&gt;
  &lt;option value = "2"&gt;2&lt;/option&gt;
  &lt;option value = "3"&gt;3&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>