I’m not familiar with what or where qty_input is an what exactly up() & select() do, so I can’t tell. It definitely works with respect to the table element.
So, we know we have an .up() tool at our disposal, and a .select() tool at our disposal. A quick glance at the prototype.js docs tell me there’s also a .next() which shifts down one sibling.
Let’s narrow HTML down to the relevant stuff: the tbody.
<tbody>
<tr class="first odd">
<td rowspan="2">
</td>
<td rowspan="2">
</td>
<td class="a-right">
</td>
<td class="a-center">
<select name="cart[11234][qty]" onchange="form.submit()" style="padding:0">
<option value="1" selected="">1</option>
<option value="2">2</option>
</select>
</td>
<td class="a-right">
$48.97
</td>
<td class="a-center last">
Remove item
Save Item For Later
</td>
</tr>
<tr class="even">
<td class="a-center last" colspan="4">
TRYING TO MOVE (Save Item For Later) TO HERE
</td>
</tr>
<tr class="last odd">
</tr>
</tbody>
the Select is inside a td. Fair enough. We dont care about anything else inside that TD. We also dont care about the options inside the select, because they’re not relevant to our navigation.
that TD is in a TR, but our target isnt inside the same TR. So we dont care about anything else inside the TR but the TD that contains our select.
There’s more TR’s in the table, but the one we’re looking for is right next to the one we start in, so we dont care about any other TR’s.
The TR our target is in contains only one TD, and it’s our target.
That narrows the relevant HTML to:
<tr class="first odd">
<td class="a-center">
<select name="cart[11234][qty]" onchange="form.submit()" style="padding:0">
</select>
</td>
</tr>
<tr class="even">
<td class="a-center last" colspan="4">
TRYING TO MOVE (Save Item For Later) TO HERE
</td>
</tr>
So. We start at the Select, and we need to move to the target, using the tools we have.
Step 1: Go up. (Now we’re at the td.)
Step 2: Go up again. (Now we’re at the tr)
Step 3: Go to the next TR (Now we’re at the second TR)
Step 4: Go down to the target TD (which is the only TD)