CSS transition in combination with JS clickEvent
问题 Encountering the following issue when trying to combine CSS transitions with JS event handlers. I know how to use CSS transition property for example: div { width: 50px; height: 50px; background: blue; transition: width 2s; } div:hover { width: 300px; } <div></div> I also know how to put a click handler on an DOM element like this: let eventDiv = document.querySelector('#clickMe'); let hiddenDiv = document.querySelector('#hiddenDiv'); eventDiv.onclick = () => { if(hiddenDiv.style.display ===