title: Javascript to select first option of select list
body: <p>I need to create a reset button which on click will set all select lists in a form to index 0. I have tried this code for function, but it gives a syntax error on myForm.length;</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;function ResetForm(form) {     
  var myForm = document.forms[form];   
    for( var i=0; i &lt; myForm.length; i++ ){                                   
  myForm.select[i].selectedIndex =0;     }  }
  
  &lt;/script&gt;
  </code></pre>