<head>
<meta charset="utf-8">
</head>
<body>
<div id="id" style="display: block; width: 200px; height: 200px; border: 1px solid grey;"></div>
<script>
document.getElementById("id").onmouseover = function() {
var color = ['red','green','blue', 'orange', 'yellow', 'violet']
this.style.backgroundColor = color[Math.round(Math.random()*color.length)];
};
</script>
</body>