jQuery/javascript - list box item deselect/show/hide not working in IE?
<p>I have the following javascript/jquery code, the purpose of which is to -</p>

<ol>
<li>Deselect a previously selected item from the list, if the selected item value exists in an array</li>
<li>Hide/display each list item dependent on whether they exist in the array</li>
</ol>

<p></p>

<pre><code>var list = $(row).find("select &gt; option")

var selectedValue = $(row).find("select &gt; option:selected")
if (selectedValue) {
    if ($.inArray(selectedValue[0].value, dependencyListItemValues) == -1) {
        alert('deselect');
        $(selectedValue).attr("selected", false);
    }
}

$(list).each(function () {
    var value = this.value;
    if (value != "") {
        if ($.inArray(value, dependencyListItemValues) &gt; -1) {
             alert('show');
             $(this).show();
        }
        else {
             alert('hide');
             $(this).hide();
        }
    }
});    
</code></pre>

<p>This is working fine in chrome and firefox, but not in IE9. When running in IE, the alert lines are hit, but the following lines seemingly do nothing:</p>

<pre><code>$(selectedValue).attr("selected", false);

$(this).show();

$(this).hide();    
</code></pre>

<p>Do I need to use alternative code so this will work in IE?</p>
