If I have an li
element like this:
<li id="1" class="show" style="display: none;">
and the CSS class contains:
.show {
display: list-item !important;
}
I attempted to retrieve the value of the display attribute with:
document.getElementById("1").style.display
which returned "none"
.
Despite the CSS class, the real display value is list-item
.
How can I use JavaScript to get the correct and applied display value?