How to Hide and Show SELECT Options with JQuery in IE
I'm trying to hide some options from a drop down. JQuery's .hide() and .show() work great in Firefox and Chrome, but no luck in IE. Any good ideas? Of many possible approaches, this method requires browser sniffing (which in general is not great) but doesn't require having multiple copies of the same select list to swap in and out. //To hide elements $("select option").each(function(index, val){ if ($(this).is('option') && (!$(this).parent().is('span'))) $(this).wrap((navigator.appName == 'Microsoft Internet Explorer') ? '<span>' : null).hide(); }); //To show elements $("select option").each