No replies
udubnate
Offline
newbie
Last seen: 14 years 2 days ago
Joined: 2005-12-12
Posts: 8
Points: 0

So I start out with my css with

#commentform
{
display: none;
}
#commentform2
{
display: block;
}

then I run

function blocking(nr)
{

if (document.layers)
{
alert(document.layers[nr].display == 'none');
current = (document.layers[nr].display == 'none') ? 'block' : 'none';
document.layers[nr].display = current;
}
else if (document.all)
{
current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
document.all[nr].style.display = current;
}
else if (document.getElementById)
{
alert(document.getElementById(nr).style.display);
vista = (document.getElementById(nr).style.display == 'none' || document.getElementById(nr).style.display == '') ? 'block' : 'none';
document.getElementById(nr).style.display = vista;
}
}

However my question is that for firefox and IE initially it doesn't grab the value that I set for my CSS sheeet. example

document.getElementById(nr).style.display == null when I start out even though I set it explicitly to block or none.

Does anyone have any ideas how I could fix this ?

Thanks!