我有那个 html
<table>
<tbody>
<tr>
<td>
<input name="price" class="chrome-input" />
</td>
<td>
<button name="sellButton" class="chrome-button">
</button>
<button name="priceButton" class="chrome-button">
</button>
</td>
</tr>
</tbody>
</table>
如何获得包含 chrome-button
类控件的 tr
。
像这样的事情
alert($("tr+.chrome-button").html());
最佳答案
$(".chrome-button").closest('tr')
关于jQuery。获取标签+类名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5571867/