if (div.id === 'firstDiv')
{
div.addEventListener('click', function() {
div.classList.remove('w-1/4')
div.classList.add('w-full')
})
}
I have this code block in a for loop, it checks the id of each div in the loop, and adds an event listener to it. However, while the event listener works if I console.log
it, it doesn’t actually do anything with the classList