I, trying to make a div clickable so it will be redirected to a different document or site but got that error. However, it works with the old way of using the onclick as an attribute inside the element.
var examscol = document.getElementById("exam-col1");
function examCol() {
return window.location.assign("https://www.w3schools.com")
}
examscol.addEventListener("click", examCol);
Any suggestions on why it isn't working with this way ?