您好,欢迎访问一九零五行业门户网

JS控制显示隐藏兼容问题(IE6、IE7、IE8)_javascript技巧

在ie7中,
使用jquery
显示:$(#a).attr(style,);
隐藏:$(#a).attr(style,display:none);
但是显示这个方法在ie8中不行
ie8
显示:$(#a).removeattr(style);
隐藏:$(#a).attr(style,display:none);
ie6,最怪异,使用display:none不能隐藏select标签
下面这两个,经测试,在三个版本中都能正常使用
隐藏:document.getelementbyid(a).style.display=none;
显示:document.getelementbyid(a).style.display=;
其它类似信息

推荐信息