if background =

by Gary Voss

HTML

<div id="img"></div>
<div id="color">test</div>

CSS

#img {
    background:blue;
    width:400px;
    height:200px;
}

JavaScript

if (document.getElementById('img').style.background = "red")
	{document.getElementById('color').style.background = "green";} 
else {document.getElementById('color').style.background = "red";}