skip to Main Content

Html – How I can add transition while switching from light mode to dark mode in Javascript

var container = document.querySelector(".container") var light = document.getElementById("light"); var dark = document.getElementById("dark"); light.addEventListener('click', lightMode); function lightMode(){ container.style.backgroundColor = "white"; container.style.color = "black"; } dark.addEventListener('click', darkMode); function darkMode() { container.style.backgroundColor = "black"; container.style.color = "white"; } It is my code, please…

VIEW QUESTION
Back To Top
Search