0

I have a HTML tag like:

<tr class="evenRow" id="5"><td align="left" noWrap="nowrap">
    <input id="array_5" type="checkbox" value="on"/> </td>
    <td align="left" noWrap="nowrap">  SAMPLE </td>
    <td align="center" id="row_at_plant_0" noWrap="nowrap" class="data-current-value" row_index="2"> 1112</td>
    <td align="left" noWrap="nowrap">  1.0457 </td>
</tr>

I have this code to get the <td> tag that has row_index attribute when array_* is checked. But it's not working in IE.

$('table#headerSelectTable input[id^="array_"]:checked').each(function() {
    input = $(this).parent().parent().find('.data-current-value');

    if ($(this).parent().parent().get(0).tagName == 'TR') {
        rows.push(input);
    }
});
JJJ
  • 32,902
  • 20
  • 89
  • 102
Ianthe
  • 5,559
  • 21
  • 57
  • 74
  • [here][1] is a similar question with a good sample [1]: http://stackoverflow.com/questions/9314902/jquery-get-parent-tr-for-selected-radio-button – i100 Jun 19 '14 at 10:16
  • What is the value of `$(this).parent().parent().get(0).tagName` when it fails? – Barmar Jun 19 '14 at 10:17
  • In what way is it failing? Is the selector not finding any checked boxes? Is `input` not getting set properly, is the `if` test failing? – Barmar Jun 19 '14 at 10:18
  • input = $(this).parent().parent().find('.data-current-value'); is not working because when I try input.attr("row_index"), it returns "undefined" – Ianthe Jun 19 '14 at 10:35

0 Answers0