Code: Select all
Uncaught TypeError: Cannot read properties of null (reading 'style')
at updateColour (coloured_fade.html:15:22)
Code: Select all
Coloured Fade
html, body {
height: 100%;
}
let body = document.body;
var i = 0;
var timerId;
function updateColour() {
body.style.backgroundColor = "hsl(${i}, 100, 45)";
i++;
}
window.onload = function() {timerId = setInterval(updateColour, 20);};