I'm trying to get an alert to appear if two conditions are met:
- The value of the
displayproperty on the#playerboxelement isblock, AND - The value of the
displayproperty on the#playerinfoelement isnone
I have this:
if ($("#playerbox").css("display") == "block" && $("#playerinfo").css("display") == "none"){
alert("test");
}
But the alert never appears. However, testing just one element will work:
if ($("#playerbox").css("display") == "block"){
alert("test");
}
So I'm assuming I'm not chaining the two selectors together correctly in the if statement. What am I doing wrong?
UPDATE: I should have specified that #playerinfo is inside #playerbox. Does that change anything?
$("#playerinfo").css("display") == 'none'?alertorconsole.logthe values before theifstatement runs to see if you are getting what you expect?