So, I have 10 balls with the same class and different ids from one to ten.
<section class="stage" >
<figure class="circle ball" id="1"><span class="shadow"></span></figure>
</section>
<section class="stage" >
<figure class="circle ball" id="2"><span class="shadow"></span>
</figure>
</section>
<section class="stage" >
<figure class=" circle ball" id="3"><span class="shadow"></span></figure>
</section>
...
How can I get on click id that is a number and that is stored in variable? I tried querySelector but it only gets me first match, then querySelectorAll but it returns nodelist... I am fairly new to js so if someone have some solution...
Thanks in advance