jQuery repeat 4 times!

Hi All,

I’m struggling to find out the correct bit of jQuery to use, so that I can repeat a process 4 times. I am trying to achieve the following:

When 1 <a> is clicked, I want jQuery to add the class current to that <a> and the next 4 <a>.

All I need to know is the correct selector or filter to use in order to achieve this?

Any help would be great!

Regards

Shaun

Without knowing your dom structure:
get all relevant a elements
find index() of clicked element in the set of a elements
slice(index, index +5)