JSFiddle - React, Tailwind, and code Playground

HTML

<div id="myDiv">HELLO</div>

CSS

#myDiv {
    display: none;
}

JavaScript

function getStyle(id, name)
{
    var element = document.getElementById(id);
    return element.currentStyle ? element.currentStyle[name] : window.getComputedStyle ? window.getComputedStyle(element, null).getPropertyValue(name) : null;
}


var display = getStyle('myDiv', 'display');
alert(display); //will print 'none' or 'block' or 'inline' etc