How to get the element Background Color in JavaScript
Use style.background
on the specific div element.
document.getElementById("yourElementId").style.background;
Example:
<div id="box" style="background: green; width: 40px; height: 50px;"></div>
<script>
var backgroundColor = document.getElementById("box").style.background;
console.log(backgroundColor)
</script>
Output (console): green