<body> <div onclick="changeCol(this)" id="square"></div> <script type="text/javascript"> var count=0; function changeCol(thediv){ var colors=["red", "blue","green","yellow","orange"] thediv.style.backgroundColor=colors[count++%colors.length] } </script> </body>
Jump To Top of Thread