Message box displays a,b,c,d
I want, message box displays a,b,c,d,e,f,g,h
While loop will be used.
Code:
  
<script type="text/javascript">

window.onload = function (){
var el = document.getElementsByTagName('select');
var arr = [] ;
var s, o,  i = 0, n = 0;
while( s = el[i++]) { 
while( o = s.options[n++] ){ arr.push(o.value); 
}
}
alert(arr); // a,b,c,d
}
</script>

<select>
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
<option value="d">d</option>
</select>

<select>
<option value="e">e</option>
<option value="f">f</option>
<option value="g">g</option>
<option value="h">h</option>
</select>