$(element).closest('tr') instead of $(element).parent().parent();