I have a JavaScript function
<script language="javascript">
function toggle_color(color1, color2, cycle_time, wait_time) {
setInterval(function first_color() {
document.body.style.backgroundColor = color1;
setTimeout(change_color, wait_time);
}, cycle_time);
function change_color() {
document.body.style.backgroundColor = color2;
}
}
</script>
I am calling it on my body onload
<body onload="toggle_color("#61beb3", "#90a2c6", 4000, 2000);">
Lorem Ipsum Dolar.
</body>
But nothing is happening. The body's background is while. Any ideas where the error might be? All I know is that the script is authentic and 100% working.