0

Here's my code:

selectList = document.querySelectorAll("li.select");

selectList.addEventListener("click", function (){
selectList.classList.toggle("open");
});

When I just did the 'querySelectorAll' part, I used console.log and it worked. Showed me how many nodes I had.

I'm trying to add the class, open to the text whenever it's clicked. Nothing is working.

Please tell me what I did wrong.

The whole code is here: https://code.sololearn.com/WSH825hFGSz7/?ref=app

0 Answers0