Home > Web Front-end > JS Tutorial > body text

JS control display and hide compatibility issues (IE6, IE7, IE8)_javascript skills

WBOY
Release: 2016-05-16 18:30:59
Original
1230 people have browsed it

In IE7,

Use jQuery

Display: $("#a").attr("style","");

Hide: $("# a").attr("style","display:none");

But this method of displaying does not work in IE8

IE8

Display: $("# a").removeAttr("style");

Hide: $("#a").attr("style","display:none");

IE6, the weirdest , using display:none cannot hide the select tag

The following two, after testing, can be used normally in three versions

Hide: document.getElementById("a").style .display="none";

Display: document.getElementById("a").style.display="";

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template