Just want to know how to select a table row by id
eg the table row has the id of "50"
...How can I select this (as I wish to use the hide() function on a click)
Just want to know how to select a table row by id
eg the table row has the id of "50"
...How can I select this (as I wish to use the hide() function on a click)
$('tr#50').click(function(ev) { $(this).hide(); });
$('tr#50') selects the row. .click(function(){...}) runs the function when you click on the row. $(this) is a way of selecting the original element that you set the click handler on (in this case, that selected by "tr#50"). And .hide(), obviously, hides that element.
EDIT: As other answerers point out, it's not good practice to start an id with a number, and even worse practice to make your id only a number. You should rename it to something like row-50.
If you don't have an ID of the table and simply wants to select the 50th row, you can select it with:
$('table tr').eq(49);
or
$('table tr:eq(49)');
Note that eq() starts on 0, and not 1. There for the eq() in this case is (50 - 1)
eq..it will be much slower