Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11295 closed bug (invalid)

.children() traversing error

Reported by: tdajka@… Owned by: tdajka@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:

Description

I've the following peace of table:

<tr id="new_1" style="">

<td id="new_range_start_1" align="center">0</td> <td>-&gt;</td> <td>

<input type="text" id="limit_1" name="limit_1" value="" onchange="setNextRow(this);">

</td> <td>

<input type="text" id="percent_1" name="percent_1" value="">

</td> <td> </td>

</tr>

When I add another row after this - tested, working fine - I want to set the new row's first cell from the previous row's 2nd cell's input with the following code:

var prev_end = parseInt($('#new_'+ranges_cnt).prev().children('td:eq(2) input').val());

it's not working. I'm getting 'undefined'. However, this code works:

var prev_end = parseInt($('#new_'+ranges_cnt).prev().children('td:eq(2)').children('input:eq(0)').val());

Change History (2)

comment:1 Changed 7 years ago by sindresorhus

Owner: set to tdajka@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.