hover programmatically vanilla js code example
Example: hover vanilla javascript
var target = document.querySelector(".button");
target.addEventListener("mouseover", mOver, false);
target.addEventListener("mouseout", mOut, false);
function mOver() {
target.setAttribute("style", "background-color:blue;")
}
function mOut() {
target.setAttribute("style", "background-color:green;")
}