I have a code like this:
const myDiv = document.querySelector("#myDiv");
myDiv.addEventListener("click", fct_Div);
function fct_Div(ev) {
console.log(ev);
if (ev.altKey === true) {
myDiv.style["background-color"] = "blue";
}
}
with CSS:
#myDiv {
width: 400px;
height: 400px;
border: 1px solid black;
}
#myDiv:hover {
background-color: lightblue;
}
I would like to access #myDiv:hover to change the background color.
Surely there is a way to do that?!
Thanks for your time,
Andreï