how to hover in inline css code example
Example 1: how to apply hover through inline css
document.getElementById("mydiv").onmouseover= function(e){this.className += ' my-special-class'; };
document.getElementById("mydiv").onmouseleave= function(e){this.className = this.className.replace('my-special-class',''); };
Example 2: how to apply hover through inline css
document.head.insertAdjacentHTML('beforeend', '<style>#mydiv:hover{color:red;}</style>');