:: a z y u r e . c o m ::

Tag: class

Hide div’s onload using class

by azyure on Oct.29, 2008, under code bits

<script type=”text/javascript”>
window.onload = hideDivs;
function hideDivs()
{
var divs = document.getElementsByTagName(‘div’);
for(var no=0;no<divs.length;no++)
{
if(divs[no].className==’homeHide’)
{
divs[no].style.display=’none’;
}
}
}
</script>

OR

<script type=”text/javascript”>
window.onload = hideDivs;
function hideDivs()
{
var divs = document.getElementsByTagName(‘div’);
for (var i in divs)
{
if(divs[i].className==’homeHide’)
{
divs[i].style.display=’none’;
}
}
}
</script>

Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...