As sdleihssirhc says below, if the element's display
is being inherited or being specified by a CSS rule, you'll need to get its computed style:
return window.getComputedStyle(element, null).display;
Elements have a style
property that will tell you what you want, if the style was declared inline or with JavaScript:
console.log(document.getElementById('someIDThatExists').style.display);
will give you a string value.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…