display = 'none' works in Mozilla but not in Chrome
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5187300/applied-style-displaynone-in-option-not-working-in-ie-but-working-mozilla">Applied style=“display:none” in &lt;option&gt; not working in IE but working Mozilla</a>  </p>
</blockquote>



<p>I have a JS that is supposed to search in a list and show only the results and hide the others and for some reason my code works only in Mozilla, any ideas how to make it work in Chrome and IE? </p>

<p>here is the code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
                    function searchit1() {
                        arrayAdmins = document.getElementById
                        var keyword = document.getElementById('searchbar1').value;
                        var xx = document.getElementById('allUsers');
                        var xy = document.getElementById('selectedUsers');
                        var selectedAdmins = [];
                        i = 0;
                        for (var i = 0; i &lt; xx.length; i++) {
                            if (xx.getElementsByTagName('option')[i].innerHTML.toLowerCase().indexOf(keyword.toLowerCase()) == 0) {
                                xx.getElementsByTagName('option')[i].style.display = 'block';

                            }
                            else {
                                xx.getElementsByTagName('option')[i].style.display = 'none';

                            }
                        }
                        var j = xy.length;
                        for (var i = 0; i &lt; xy.length; i++) {
                            if (xy.getElementsByTagName('option')[i].innerHTML.toLowerCase().indexOf(keyword.toLowerCase()) == 0) {
                                xy.getElementsByTagName('option')[i].style.display = 'block';

                            }
                            else {
                                xy.getElementsByTagName('option')[i].style.display = 'none';

                            }
                        }
                    }

                &lt;/script&gt;
</code></pre>

<p>Thank you</p>
