Click here to Skip to main content
15,916,371 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Suppose I have many sections and there is a common class in that section, now I want to take a span tag in the section and see the number of that class separately in that span tag.

What I have tried:

I used $('.className').length but it shows total class numbers. but I wanted to see every class's serial number in this specific section.
Updated 22-Dec-22 4:22am

1 solution

You've given us virtually nothing to work with, so all we can do is give you a generic answer.

Based on the vague description, it sounds like you want a CSS counter:
Using CSS counters - CSS: Cascading Style Sheets | MDN[^]

If that's not what you want, then you're going to have to provide a lot more detail than you have provided so far.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900