IE9 and <select/>, why u no work?

By Jaaap on Wednesday 2 November 2011 17:55 - Comments (6)
Category: -, Views: 4.484

Ok i understand this horse has been beaten to death far too many times but...

It is so frustrating to work with <select/>'s in IE.

Let's try this for instance:

JavaScript:
1
2
var sel = document.getElementsByTagName("select")[0];
alert(sel === sel.options);


This is false in every browser (as it should be) except IE(9)!

This means that if you have a function that accepts HTMLElements AND NodeLists, there is no way of distinguishing between a select and its options in IE.

Let's try something else:

HTML:
1
2
3
4
5
<select name="make">
    <optgroup label="Alfa Romeo">
        <option>Giulietta</option>
    </optgroup>
</select>



Now try to change the optgroup label's font-style to normal (it's bold and italic).
Cannot be done! How do you explain that to a customer?

Please Microsoft, fix these issues.