I am making a chrome extension that changes element background color, but after changing
the:hover selector doesn't work anymore.
I saw this question but in my case, I can't change the CSS rule to !important
is it possible to programmatically change element style without override:hover rules?
For example:
var div = document.querySelector("div");
div.onclick= function(){
div.style.background="red";
//after doing that the hover is not working anymore
}
div{
height:100px;
width:100px;
background:green;
}
div:hover{
background:blue;
}
<div>
I want the background to be red but to still have the blue on :hover.