Answer the question
In order to leave comments, you need to log in
How to get the number of the clicked element in js?
https://jsfiddle.net/crmyc4d1/2/
I want to make tabs on pure js, with an unknown number of tabs and content data, in case a few more are added
to jq, there is a useful index function...
I'm thinking how to do the same on native js?
I'm thinking of doing something like... add data-* to some clicked element, and then count from the first element until I encounter that data-*
How would you do it?
Answer the question
In order to leave comments, you need to log in
FullPage will probably do , it's the one used on the site above.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question