jQuery “visible” doesn't work in all browsers, but in Firefox

 ̄綄美尐妖づ 提交于 2019-12-04 09:53:30
Widor

It's not a jQuery bug - just (yet another) browser difference.

IE won't let you set display:none on option elements (style.display='none' doesnt work on option tags).

If you look at your fiddle in both FF and IE, you'll see that the <select> still contains all four elements in IE, but only two in FF, regardless of jQuery being present.

The solution would probably be to actually remove the elements and replace when needed.

Indeed, :hidden and :visible don't work on <option>'s

You could try to use disabled="disabled" see:

http://jsfiddle.net/sZR2f/7/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!