I have a list of 37 links and 37 hidden divs with some text. The counter starts at 3 and ends at 40. What I would like to do is display the div when I click the link, and also hide all other divs.
The links are as follows:
<a href="#" rel="week_3">Week 3</a> <a href="#" rel="week_4">Week 4</a>
Divs look like this:
<div id="week_3" style="display: none">[...]</div> <div id="week_4" style="display: none">[...]</div>
I would like to accomplish this task with jQuery. What I donβt know how to do is create a loop and check if any of these links have been clicked.
source share