...

View Full Version : checking/changing the status of a style



niche
12-09-2011, 08:22 PM
How do I check the status of a style?

I thought something like this would work, but no joy:
divTest = document.getElementById('link_container');
if (document.divTest.style.display == "none") {
}

DaveyErwin
12-09-2011, 09:35 PM
<p id = "link_container" style="display:none;">Link</p>

<script type = "text/javascript">
divTest = document.getElementById('link_container');
if (divTest.style.display == "none") {
alert("hi")
}
</script>

niche
12-11-2011, 09:24 PM
DaveyErwin, thanks for your help.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum