get closest children

by karin

HTML

<table border="1">
    <tr><td>1</td><td class="bbReason">this is the reason</td><td class="t">3</td></tr>
    <tr><td>11</td><td class="bbReason">this is the reason2</td><td class="t">33</td></tr>
    <tr><td>111</td><td class="bbReason">this is the reason3</td><td class="t">333</td></tr>
</table>

CSS

.t{
    background:peru;
    cursor:pointer;
}

JavaScript

$('.t').on('click',function(){
 var getReason=$(this).closest('tr').children('td.bbReason').text();
     alert(getReason);
 });