[Project_owners] Re: How to hide a <div> in JS

Philip Chee philip.chee at gmail.com
Tue Aug 16 10:37:36 EDT 2005


On Tue, 16 Aug 2005 00:40:21 +0200, Michael Vincent wrote:
> I need to hide a <div> element on a web page in JavaScript. The 
> following code works with Mozilla:
> 
> <script language="JavaScript1.2">
> <!--
> var myDiv = document.getElementById("MyDiv");
> myDiv.setAttribute("style", "display: none;");
> //-->
> </script>
> 
> but it fails to work in MSIE. What do I need to make it work with MSIE 
> as well?

?For IE Perhaps?:

myDiv.style.propertyName or
document.all["myDiv"].style.propertyName

Don't know if these will help but:

<http://www.mozilla.org/docs/web-developer/csspapi/csspapi.html>
Cross-Browser DHTML Technote:
API For Setting CSSP Properties From JavaScript

<http://www.mozilla.org/docs/web-developer/css1technote/css1tojs.html>
Cross-Browser DHTML TechNote:
Code Generator for Setting CSS1 Properties from JavaScript

<http://www.oreillynet.com/pub/a/javascript/2002/01/23/crossbrowser_style.html>
Cross-Browser Style Objects

<http://www-128.ibm.com/developerworks/web/library/wa-ie2mozgd/>
Migrate apps from Internet Explorer to Mozilla
How to make Internet Explorer-specific Web applications work in
Mozilla-based browsers


Phil
-==-
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://fashblock.mozdev.org/
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Xerox never comes up with anything original ...
* TagZilla 0.059
-- 
-==-
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://fashblock.mozdev.org/
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.


More information about the Project_owners mailing list