复制代码 代码如下:
复制代码
<html>
<table class=”ed”>
<tr>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="button"></input></td>
<td><input type="text"></input></td>
</tr>
</table>
</html>
<html>
<table class=”ed”>
<tr>
<td><input type="text"></input></td>
<td><input type="text"></input></td>
<td><input type="button"></input></td>
<td><input type="text"></input></td>
</tr>
</table>
</html>
需要定位到第三个文本框的时候:
复制代码 代码如下:
复制代码
$(“.ed input:text)”).eq(3)
$(“.ed input:text:eq(3)”)
$(“.ed input[type=”text”]”).eq(3)
$(“.ed input[type=”text”]:eq(3)”)
$(“.ed input:text)”).eq(3)
$(“.ed input:text:eq(3)”)
$(“.ed input[type=”text”]”).eq(3)
$(“.ed input[type=”text”]:eq(3)”)
其中.ed中ed是class="ed"。
最后
以上就是悲凉玉米最近收集整理的关于jquery 定位input元素的几种方法小结的全部内容,更多相关jquery内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复