Here's the code snippet I'm working with:
var exit = document.getElementById("exit");
exit.onclick = function() {
"use strict";
document.getElementById("fadedDiv").style.display = "none" ;
};
However, when I check the console, it shows me this error message:
script.js:107 Uncaught TypeError: Cannot set property 'onclick' of null
This code used to work fine for me before, but now I'm not sure what went wrong.
Any assistance would be greatly appreciated. Thank you!