I\'m interested in a way to check whether an element has display:none style explicility (ie style=\"display:none\"), has a class that has (or inherits) this style, or one of
Each case will need its own check and you need to know the ID of that element. First, grab the element (just doing this to make the code readable):
var MyElementName = document.getElementById("MyElementName");
Then do your checks:
Case 1:
if (MyElementName.style.display == "none")
Case 2, looking at the parent, checking FF first:
if ((MyElementName.previousSibling.nodeType == 3 )
&& (MyElementName.parentNode.nextSibling.style.display == "none"))
then for other browsers:
else (MyElementName.parentNode.style.display == "none")
Case 3, look for an applied css class:
if (MyElementName.className = "SomeClass")