0
Good morning guys, everyone have a great holiday.
I have a javascript function that counts a list like this:
let counting = document.querySelectorAll("option:checked");
At first I thought it worked, but I saw that when I cleaned the list, there were still two items left in the count, which I found to be from other elements <select>
that exist on the same page.
You can filter querySelectorAll, for example only count options, select has a specific id for example?