JSFiddle - React, Tailwind, and code Playground
by Adam DT
HTML
<body>
<table>
<tr>
<td>Hello there</td>
<td id="HDD">I want to know this cell's color</td>
</tr>
</table>
</body>
CSS
TD {
TEXT-ALIGN: CENTER;
BORDER: 2PX SOLID BLACK;
BORDER-COLLAPSE: COLLAPSE;
BACKGROUND-COLOR: #D0A9F5;
}
TABLE{
BORDER-COLLAPSE: COLLAPSE;
}
}
JavaScript
//document.getElementById("HDD").style.background="#D0A9F5"
var myColor = document.getElementById("HDD").style.background;
alert(myColor);