I'm trying to find out if a specific element has an inline style attribute or not: I'm sure there's an easy method to check this, but I can't seem to find it. I tried multiple things already including this:
var contentWrapper = document.getElementById("contentWrapper");
if(contentWrapper.style.display.toString=="")
alert("Empty");
else
alert("Not Empty");
Thank you for your help!
getAttribute('style')display.toString == ""is comparing the function , when you want to compare the return value of the function. It should bedisplay.toString() == "". (Not that you need.toString()here anyway, asdisplayis already a string, but it's another reason why your code might fail)