JSFiddle - React, Tailwind, and code Playground

HTML

<body>
    <div id="button">Click<div>
    <div id="box"></div>
</body>

CSS

#button {
    width: 40px;
    height: 20px;
    border: 1px solid;
}
#box {
    width: 50px;
    height: 50px;
    background-color: red;
    display: block;
}

JavaScript

document.getElementById('button').onclick = function() {
     element = document.getElementById('box');
     style = window.getComputedStyle(element),
     display = style.getPropertyValue('display');
    alert(display);
}