Options with display:none not hidden in IE

后端 未结 10 1019
梦如初夏
梦如初夏 2020-11-27 17:41

I have multiple options in a select. I have sorted the options and disabled and hidden the duplicate options with jquery. The code works well in chrome and firefox but in IE

10条回答
  •  清酒与你
    2020-11-27 18:29

    If somebody still faces this issue, here is my solution, it may be helpfull:

    $('select.some-list option[id=someId]').attr('disabled', 'disabled').hide();
    

    This hides the option in all browsers and disables if can't hide :). To bring back the option do not forget to enable it:

    $('select.some-list option[id=someId]').removeAttr('disabled').show();
    

提交回复
热议问题