Jump to content

JavaScript and CSS


utahcon

Recommended Posts

I apologize if this is the wrong place for this question, I am a newbie, but I didnt see a specific forum for DHTML/AJAX so I figured JavaScript was the next place to look.I am having problems with my style control.I have set in my CSS

#loginForm {display: block;}#blog {display: none;}

and in my js

function toggleDiv(divName){	alert(divName + " is " + document.getElementById(divName).style.display)	if(document.getElementById(divName).style.display  == 'block'){		document.getElementById(divName).style.display = 'none';	} else {		document.getElementById(divName).style.display = 'block';	}}

when the function runs nothing is brought up for the document.getElementById(divName).style.displayam I missing something?I have also tried document.getElementById(divName).style.display.valuewhich gives me nothing.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...