Selector / Traversing Question
in Using jQuery
•
12 years ago
Hey guys, anybody have a better way to achieve this. I am thinking I took the very long way...
//page code
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td id="tdVal">
<input name="ctl00$MainContent$gvwWizard$ctl09$txtApprovalOrder" type="text" value="0" maxlength="3" id="ctl00_MainContent_gvwWizard_ctl09_txtApprovalOrder" title="enter the order in which this item should fall in the approval process" class="txtSortOrder" />
</td>
<td id="tdUpDown">
<img border="0" class="imgUp" id="numberUp" src="../Images/number_up.gif" alt="increase approval order" />
<img border="0" class="imgDown" id="numberDown" src="../Images/number_down.gif" alt="decrease approval order" />
</td>
</tr>
</table>
//in a function when the image is clicked...get the input box in the TD next to me
inputBox = $(e.target).parent().parent().children(
"td:first").children("input:first");
1