What I want to do here is to capture the id of every row the user right clicks on. So, if a user right clicks on a row that has an id=22, then I need to capture '22'. I'm new to Jquery.
Here is what I have so far:
$("tr").mousedown(function(event) {
if (event.which === 3) {
alert($(this).attr("id"));
}
});
This doesn't give me anything back though. Each <tr>
has an id attached to it. How to get it is the question.
EDIT:
Even using 'tr', I am not able to detect a mousedown event for some reason.