Hi, I have a table that is generated by php (it has to be). Each row has a link that calls a javascript function. When the table is generated each link is given a number to put in the function call, like so:

Code:
<tr><td><a href="javascript:void(0);" onclick="doSomething('1');">Link 1</a></td></tr>
<tr><td><a href="javascript:void(0);" onclick="doSomething('2');">Link 2</a></td></tr>
<tr><td><a href="javascript:void(0);" onclick="doSomething('3');">Link 3</a></td></tr>
<tr><td><a href="javascript:void(0);" onclick="doSomething('4');">Link 4</a></td></tr>
<tr><td><a href="javascript:void(0);" onclick="doSomething('5');">Link 5</a></td></tr>
Then in my javascript I can do something based on the number:

Code:
function doSomething(number) {
//  do something with number. ajax call etc
}
But in jquery, I noticed that you define the onclicks in the code itself and not the links:

Code:
$("#linkid").click(function(){
 // do something. But how can I distinguish between each link?
 });
I could have one function for each link, but that seems silly and long winded. Plus I don't know in advance how many rows will be generated. It could be 5000 rows!

What is the way around this? I'm a bit confused by the move over to jquery tbh.

David