# Css + javascript stuff

**URL:** <https://forum.kirupa.com/t/css-javascript-stuff/63534>\
**Category:** Uncategorized\
**Created:** [September 7, 2004, 6:53pm UTC](https://forum.kirupa.com/t/css-javascript-stuff/63534 "2004-09-07T18:53:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andr\_in](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/andr_in/32/37_2.png) [@andr\_in](https://forum.kirupa.com/u/andr_in)\
**Post date:** [September 7, 2004, 6:53pm UTC](https://forum.kirupa.com/t/css-javascript-stuff/63534/1 "2004-09-07T18:53:17Z")

</div>

so I have this in css on a div:

display: none;

and the problem is that in javascript “style.display” isn’t the same as the “display” in css  
If I do

alert(somediv.style.display);

then it’s blank

I need to somehow have the default of “style.display” to be “none” or something. Can’t I somehow do it with css?

I could always use a for loop to change the “style.display” of all my divs to “none” but is there a more decent way out of this?
