Here's the JavaScript snippet I'm using:
reset.addEventListener("click", function(){
document.querySelector("#body").classList.add("darkenPage");
myReset();
alert("Reset Successful!!");
document.querySelector("#body").classList.remove("darkenPage");
});
And this is the corresponding CSS:
.darkenPage {
background: rgba(0, 0, 0, 0.5);
}
Despite trying a CSS snippet I found online, the background doesn't get darker. The browser I'm using is Chrome.
.darkenPage {
height: 100%;
width: 100%;
position:fixed;
top: 0px;
left: 0px;
background-color: rgb(0, 0, 0);
}