开发者

accessing the next tr from an input in the row above using jquery

开发者 https://www.devze.com 2022-12-24 10:45 出处:网络
Is there any way to access a tr from an input of a tr above without adding row specific id\'s or classes?

Is there any way to access a tr from an input of a tr above without adding row specific id's or classes?

<table>
<tr><td>just another row</td>
<tr><td><input name="inputToSerachFrom" type="text" /></td><tr>
<tr><td>I want to acces this row without adding id's or classes</td><tr>
<tr><td>just another row</td>
</table>

var rowINeed = $("input[name=i开发者_JAVA百科nputToSerachFrom]").closest("tr").parent().noIdea();


To access the next tr from the input, without using any IDs, you can use this:

var nextRow = $(this).parents('tr').next();


$("input[name=inputToSerachFrom]").closest("tr").next('tr:first')
0

精彩评论

暂无评论...
验证码 换一张
取 消