Why doesn't this work in IE8 to deselect all options in a multiline selectbox?
$("#myselect").children().removeAttr("selected");
Is there a workaround? Nothing I could think of (attr("selected","") etc) seems to work.
UPDATE: Here is an updated jsFiddle. I have at least got it to degrade so that in IE8 the first option is selected. But without the hardcoded selected='selected' and the .attr call that IE8 seems to need, it does 3 different things in Firefox, Chrome and IE8! See this version:, which is simple and seems like it should work:
- in Firefox: nothing selected
- in Chrome: 0th option selected
- in IE8: 1st option selected
Maybe I have made myself crazy and there is a mistake in there somewhere I can't see?