I wrote some jQuery code to .hide() an <option>
element in a select dropdown. .hide() is what I want, because later I can call .show() and the options will not need to be resorted, since the now visible option element will not have changed positions.
.hide() worked great in FF/Chrome, but not in IE6/7/8. So my thought was to write more code after the hide which determined if the current browser was capable of hiding the element (rather than writing browser version sniffing code). IE reports that yes, the option element is hidden (even though it isn't).
$('option.hideMe').hide(); var result = $('option.hideMe').is(':visible');
//result === false in IE, but it is still visible in the dropdown.
Before I rewrite the code to either 1) browser sniff or 2) use a different method which includes sorting on all browsers, is there another way of determining this situation?