I'm a beginner and i'm trying to do something easy to start with, i just want to be able to click on a div and when i click i will see the id of the div i clicked in the console. I can't figure out what's wrong with the code.
So basically, theres a div with 3 other div in it, i want to be able to click on each of them and depending on which one i clicked, receive the good id in the console.
I tried adding another console.log in the onclick to see if i was able to go into it at all but even that doesn't appear.
the "#parties" is the big div containing the 3 smaller div and the .partieind is the class given to those.
I have tried the querySelectorAll as well, but still nothing.
contPartie = document.querySelector("#parties");
console.log("just before onclick");
contPartie.querySelectorAll(".partieind").onclick = () => {
console.log("in onclick");
console.log(this.id);
}