From dc53b9cf23b47ebcc40d7beec1fa68f92d6167cf Mon Sep 17 00:00:00 2001 From: lancaster215 Date: Wed, 7 Oct 2020 11:07:02 +0800 Subject: [PATCH] add mousehover --- colcha.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/colcha.js b/colcha.js index 7b69cf8..db2f52c 100644 --- a/colcha.js +++ b/colcha.js @@ -8,3 +8,10 @@ button.addEventListener("click",function(){ document.body.style.background="yellow"; filled=!filled; }); + +button.addEventListener("mouseover", (e) => { + e.target.style.color="orange"; + setTimeOut(() => { + e.target.style.color=""; + }, 1000); +}, false);