Problem iterating options of select element in javascript
<p>My problem is that apparently it only iterates once, if for example i write document.write(selectmenu.options[pos].value) it prints 4 out of 5 but if i do that document.getElementBy id it only iterates once i dont know why. Thanks</p>

<pre><code>function selectShowHide( selectmenu ){
document.getElementById((selectmenu.options[selectmenu.selectedIndex]).value).style.display='block';
for(var pos=0;pos&lt;selectmenu.options.length;pos++){
    if(selectmenu.options[pos].value!=selectmenu.options[selectmenu.selectedIndex].value)
        document.getElementById(selectmenu.options[pos].value).style.display='none';
}
</code></pre>
