utahcon Posted September 21, 2006 Share Posted September 21, 2006 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 More sharing options...
Webworldx Posted September 21, 2006 Share Posted September 21, 2006 Are you using IE? Unless you define the style through<div id='blog' style='display: block;'>IE won't show anything for style.display. Link to comment Share on other sites More sharing options...
utahcon Posted September 21, 2006 Author Share Posted September 21, 2006 actually no, I am using Fx, but I will try it anyways. Are you using IE? Unless you define the style through<div id='blog' style='display: block;'>IE won't show anything for style.display. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now