I'm new at programming and I am trying different things and today I tried this:
HTML:
<button id="button">Blue button</button>
JavaScript:
let button = document.getElementById("button");
button.onclick = function() {
element.style.backgroundColor = "red";
element.style.color = "white";
element.innerHTML = "Red Button";
}
And the console says: cannot set property 'onclick' of null