I have a simple piece of PHP which generates n copies of the following code:
Like Brian said, you could just put the same class on all of your links and use the $(this)
keyword in jQuery inside of a click function to find out which link was clicked.
Here's a basic example of changing link colors on a nav using this technique: http://jsfiddle.net/9E7WW/
HTML:
Test
Test2
Test3
Test4
Javascript:
$(document).ready(function(){
$('.nav').click(function(){
// change all to black, then change the one I clicked to red
$('.nav').css('color', 'black');
$(this).css('color', 'red');
});
});