I wanted to change bg color in this order: [Black,White,Red,Green,Blue]
<body style="background-color:black">
<script type="text/javascript">
function test() {
var bg = document.bgColor;
var e = document.getElementById("tests");
if (bg == "black") {e.style.backgroundColor = "white";}
else if (bg == "white") {e.style.backgroundColor = "red";}
else if (bg == "red") {e.style.backgroundColor = "green";}
else if (bg == "green") {e.style.backgroundColor = "blue";}
else if (bg == "blue") {"<a href="/testson"/>";}
}
</script>
<div class="test"; onclick="test()"></div>
</body>
But when I click somewhere on page, nothing happens.