$(this).parents('table:first').find('tr'))
The above will search for tr inside table recursively,how to make it only search for the top tr?
EDIT
children is not working as expected:
alert($(this).parents('table:first').children('tr').length)
gives 0