Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;")
}
Source by selekkt.dk #
 
PREVIOUS NEXT
Tagged: #hover #vanilla #javascript
ADD COMMENT
Topic
Name
2+2 =