codice:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#mb").click(function(){
    alert($(this).parent().parent().attr("id"));
    }
  )
});
</script>
</head>
<body>
<table>
<tr id='r1'>
<td><button id='mb'>clicca</button></td>
</tr>
</table>
</body>
</html>