显示选项:none没有隐藏在IE中 [英] Options with display:none not hidden in IE

查看:82
本文介绍了显示选项:none没有隐藏在IE中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在选择中有多个选项。我已经排序的选项,并禁用和隐藏与jQuery的重复选项。该代码在Chrome和Firefox中运行良好,但在IE和safari中,display:none的选项仍然显示出来。

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 and safari, the options with display:none are still showing up.

以下是代码的jsfiddle:

Here is the jsfiddle of the code:

<select>
  <option value="5797">34</option>
  <option value="5809">37</option>
  ... 
  <option value="5653">71</option>
  <option disabled="" selected="selected" value="53">Eye</option>
  <option disabled="disabled" style="display: none;" value="5441">52</option>
  <option disabled="disabled" style="display: none;" value="5443">52</option>
  ...
  <option disabled="disabled" style="display: none;" value="5431">51</option>
</select>

http:// jsfiddle.net/7vUdb/

推荐答案

IE不支持 style =display :none;< option> 标签上。

IE doesn't support style="display:none;" on <option> tags.

您唯一的选择是删除它们 - 作为HTML创建的一部分,或通过客户端脚本。

Your only option is to remove them - either as part of the creation of the HTML, or via client-side script.

这篇关于显示选项:none没有隐藏在IE中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆