Is it possible to achieve the following using nth-child and an if else statement?
Say there are 9 divs and each one has a link inside that when clicked performs a function. Could I somehow have the the link figure out what nth-child div (from the body tag) it is inside and perform the function only if it’s inside the 3rd, 6th or 9th div? I really have no idea where to begin but it seems possible.
You can use nth-clild,
Live Demo
For binding event, you can use click()
Live demo