I have a <div>, and I want to toggle its classes on hover.
Here is my code:
function a(){
this.classList.toggle('first');
this.classList.toggle('sec');
}
document.querySelector('#container').addEventListener('click', a );
I am confident there is no issue with my HTML or CSS. Simply put, I need to make a change and substitute something else for the click, but I'm not sure what.
Please assist!