I’ve got 5 li’s in a ul and a button . On clicking the button I want to add a class to the first li then on the second click remove the class from the first li and add it too the second ect . I know i could just give each li an individual id but i know there must be a better way and I’ll probably want it to be dynamic at some point as well .
thanks in advance .
Here’s a working solution: http://jsfiddle.net/PFpaU/
With comments: http://jsfiddle.net/PFpaU/1/
JS:
HTML:
CSS: