robert_gsfame Posted April 30, 2010 Share Posted April 30, 2010 I try to use .style.display to check whether the style.display is none, but it didnt work how can i check the style display if(document.getElementById("a").style.display=="none){ alert("none")} Link to comment https://forums.phpfreaks.com/topic/200277-check-whether-styledisplaynone/ Share on other sites More sharing options...
KevinM1 Posted April 30, 2010 Share Posted April 30, 2010 I try to use .style.display to check whether the style.display is none, but it didnt work how can i check the style display if(document.getElementById("a").style.display=="none){ alert("none")} It should work. Show where your JavaScript is in relation to your HTML. Link to comment https://forums.phpfreaks.com/topic/200277-check-whether-styledisplaynone/#findComment-1051035 Share on other sites More sharing options...
Ken2k7 Posted April 30, 2010 Share Posted April 30, 2010 No; it shouldn't work. There is a missing parenthesis. Link to comment https://forums.phpfreaks.com/topic/200277-check-whether-styledisplaynone/#findComment-1051062 Share on other sites More sharing options...
KevinM1 Posted April 30, 2010 Share Posted April 30, 2010 No; it shouldn't work. There is a missing parenthesis. Actually, it's a missing quote. And I assumed it was a typo that the OP made from not simply copying his code, but rather rewriting it here in a hurry. Link to comment https://forums.phpfreaks.com/topic/200277-check-whether-styledisplaynone/#findComment-1051067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.