nth-child, index()

Hello everyone , I have 23 divs each containing 210 spans. When I click on a span with certain number it gets a red outline as a highlighting and I want to copy this outline to all spans with this number in all divs. So far I have this code using nth-child and index(). It works but the problem is that index is 0-based so when I click on a span number 2 I get outline on span number 1. I know there is a trick with adding +1 but I can't figure out how to add it in this specific case. And I don't know if it's even possible. If so I guess it's just a matter of syntaxis I don't know. I will be very happy if anybody can help.
discord-1.jpg
discord-2.jpg
Was this page helpful?