title: getElementsByClassName() is not working
body: <p>The follwing code is to sort form list options alphabetically but the 'getElementsByClassName()' is not working and I cant figure out why.</p>
  
  <p>I am using the latest jQuery.</p>
  
  <pre><code>window.onload=function(){
      function sortlist() {
          var cl = document.getElementsByClassName('car_options');
          var clTexts = new Array();
  
          for(i = 1; i &lt; cl.length; i++) {
              clTexts[i-1] =
                  cl.options[i].text.toUpperCase() + "," +
                  cl.options[i].text + "," +
                  cl.options[i].value;
      }   
      clTexts.sort();
  
      for(i = 1; i &lt; cl.length; i++) {
          var parts = clTexts[i-1].split(',');
          cl.options[i].text = parts[1];
          cl.options[i].value = parts[2];
      }
      sortlist();
  }
  </code></pre>
  
  <p>in body section</p>
  
  <pre><code>     &lt;form action="" method="get"&gt;
  
          &lt;p&gt;&lt;label for="car_make"&gt;&lt;/label&gt;
            &lt;select id="car_make"  class="car_options" name="car_make"&gt; 
  
              &lt;option value=""&gt;By Make&lt;/option&gt;
              &lt;option value="Vauxhall"&gt;Vauxhall&lt;/option&gt;
              &lt;option value="BMW"&gt;BMW&lt;/option&gt;
              &lt;option value="Toyota"&gt;Toyota&lt;/option&gt;
              &lt;option value="Lexus"&gt;Lexus&lt;/option&gt;
              &lt;option value="Audi"&gt;Audi&lt;/option&gt;
              &lt;option value="Ford"&gt;Ford&lt;/option&gt;
  
                  &lt;/select&gt;
  
  
            &lt;label for="car_color"&gt;&lt;/label&gt;
  
            &lt;select name="car_color" id="car_color" class="car_options"&gt;
                    &lt;option value=""&gt;By Color&lt;/option&gt;
  
              &lt;option value="Red"&gt;Red&lt;/option&gt;
              &lt;option value="Blue"&gt;Blue&lt;/option&gt;
              &lt;option value="Black"&gt;Black&lt;/option&gt;
              &lt;option value="Grey"&gt;Grey&lt;/option&gt;
  
  
            &lt;/select&gt;
  
  
            &lt;input type="submit" name="search" id="search" value="Search"&gt;
           &lt;/form&gt;
  </code></pre>