I am grabbing the element below like:
let box = document.querySelector('.zero');
When I go to check the backgroundColor in javascript, it shows as ""
:
box.style.backgroundColor // ""
If I'm grabbing the element node, why doesn't it list the backgroundColor as #DCDCDC
, like what I set it in my CSS as? I assume it's due to the multiple classes on the element but not sure why.
code:
<div class="tic-tac-box zero">
</div>
.tic-tac-box {
background-color: #DCDCDC;
border-radius: 5px;
border: 2px solid white;
}