Answers for "how to access a hover in the dom"

13

addeventlistener hover js

let test = document.getElementById("test");

test.addEventListener("mouseover", function( event ) {
  alert("mouse over test!")
  , false);
Posted by: Guest on May-31-2020
0

hover con js

// Creamos el evento mouseover para cada imagen
	imagenes[i].addEventListener("mouseover", function(e){
		document.getElementById("mostrar").style.backgroundImage="url('"+e.target.currentSrc+"')";
	});
 
// Creamos el evento mouseout para cada imagen
imagenes[i].addEventListener("mouseout", function(e){
  document.getElementById("mostrar").style.backgroundImage="";
});
Posted by: Guest on February-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language