You don't need to attach an event for every single table row as this will consume unnecessary memory. Yo could rely on event bubbling instead, and attach just one event to the entire table:
$('table').on('click', 'tr', function(event) { $(event.target).hide(); });