Mise en place d’événement sur les blocs
Array.from(document.querySelectorAll('div'),el => {
let c = "votre couleur";
el.style.color = el.style.background = c;
el.addEventListener("mouseover", function( event ) {
// highlight the mouseover target
event.target.style.color = "white";
// reset the color after a short delay
setTimeout(function() {
event.target.style.color = c;
}, 5000);
}, false);}
);
Action
JS Bin on jsbin.com