+ 1
Why this click counter by class-name is not working.
I created a project that: When the user clicks on the ring, the user will see how many times the user has clicked. project link: https://code.sololearn.com/WzLObhteFHfH/?ref=app Problem: It works when I use ID but not when I use classes. Why? Please explain.
10 Respostas
+ 5
It is because getElementsByClassName returns a nodelist, not a single node like getElementById does. To access the node (the first node), you need to use getElementsByClassName[0].html...
+ 3
Create a for loop and access each one separately.
+ 3
To make all 3 clickable you need to add the onclick="numup()" attribute to the other two in your HTML tab.
+ 2
By this first box will work
How can all node work?
+ 2
But all circle work in one click,how to fix plz give me ans with code plz plz plz
+ 2
When i click first class all class show num
+ 2
I no longer understand your question. I thought that you wanted all circles to change when you click the top one. That is what is happening with your code right now. If this is not right, can you please explain fully what you want to happen?
+ 2
I want to make 3 click counter
But separate
+ 1
There are 3 things to do:
Task 1:
User has to click 1st circle 33 times.
Task 2:
User has to click 33 times 2nd circle.
Task 3:
The user has to click 33 times on the 3rd circle.
It will show how many times the user has clicked
+ 1
Plz tell me how can i fix my code for this 👆👆👆