At first I thought you needed to use background-color, but I was wrong. If you use inline styles, your command will work, but it's not grabbing it from the stylesheet. I've had that problem before. Doing some more research.
This line of code is working but for some reason it is returning an empty string. I have set the css background color of the div in internal(not inline) css above the div. What am I missing here?PHP Code:
echo "<div id='d1' onclick=\"alert(this.style.backgroundColor)\" width='100%'>content</div>";
Thanks,
NewTechGuy
At first I thought you needed to use background-color, but I was wrong. If you use inline styles, your command will work, but it's not grabbing it from the stylesheet. I've had that problem before. Doing some more research.