I am trying to make it so my websites background changes colour randomly every few seconds. I can get it to change to a random colour but how do I make it loop?
<script type="text/javascript">
$(document).ready(function() {
var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
function colourSet(){
$("body").animate({ backgroundColor: hue}, 2000);
}
colourSet();
});
</script>