How to Hide and Show SELECT Options with JQuery in IE

前端 未结 3 758
后悔当初
后悔当初 2021-01-18 00:12

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 g

3条回答
  •  走了就别回头了
    2021-01-18 00:42

    Just to mention that IE11 navigator.appName returns 'Netscape' :) So taking it into consideration:

    $("select option[value='your_option_value']").wrap((navigator.appName == 'Microsoft Internet Explorer' || navigator.appName == 'Netscape') ? '' : null).hide();
    

提交回复
热议问题