Finding parent class and id

Posted by Breezer on Stack Overflow See other posts from Stack Overflow or by Breezer
Published on 2010-05-20T03:10:06Z Indexed on 2010/05/20 3:20 UTC
Read the original article Hit count: 290

Well after countless tries i can't get this work?

<script type="text/javascript">
    $("td input").focusout(function() {
      var column = $(this).parent('td').attr('class');
      var row = $(this).parent('tr').attr('id');
      $('#dat').HTML(row+" "+column);
    }); 
</script>

And the html looks like this

<tr class="numbers" id="1">
<td class="a" align="right">1</td>
<td class="b"><input class="input" type="text" value=""/></td>
<td class="c"><input class="input" type="text" value=""/></td>

<td class="d"><input class="input" type="text" value=""/></td>
<td class="e"><input class="input" type="text" value=""/></td>
<td class="f">0</td>
<td class="g"><input class="input" type="text" value=""/></td>
</tr>

can anyone point me to the right direction on what might be wrong? thanks in advance

regards

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript