jquery 定位input元素的几种方法小结

时间:2013-07-28    点击:90   
复制代码 代码如下:

<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中ed是class="ed"。
使用js正则控制input标签只允许输入的值
js为鼠标添加右击事件防止默认的右击菜单弹出
js保留两位小数使用toFixed实现
jquery图片不完全按比例自动缩小的简单代码
jquery验证手机号码、邮箱格式是否正确示例代码
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved