css - Best way to switch between two colours with javascript? - Stack Overflow

PHOTO EMBED

Mon May 22 2023 19:54:22 GMT+0000 (Coordinated Universal Time)

Saved by @LeoDivine #javascript

document.querySelector('#myButton').addEventListener('click',e => {
  e.target.classList.toggle('black')

})
content_copyCOPY

https://stackoverflow.com/questions/56110588/best-way-to-switch-between-two-colours-with-javascript