title: how to get the selected index from a getElementByClassName
body: <p>I want to get the selected index from a getElementByClassName.</p>
  
  <p>I know how can I get it from Id but somehow its not working for ClassName..</p>
  
  <pre><code>   document.getElementById("Metriclayer").selectedIndex = abc;
  </code></pre>
  
  <p>like this how can I get it for document.getElementByClassName. </p>
  
  <p>I want to set the value of abc( its an integer) in the selected index of <code>document.getElementByClassName("MetricClass").</code></p>
  
  <p>How can I do that .</p>