jquery 定位input元素的幾種方法小結
更新時間:2013年07月28日 15:18:21 作者:
本文以定位到第三個文本框為例為大家詳細介紹下jquery 定位元素幾種方法,感興趣的朋友可以參考下,希望對大家有所幫助
復制代碼 代碼如下:
<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"。
相關文章
jQuery中bind,live,delegate與one方法的用法及區(qū)別解析
本篇文章主要是對jQuery中bind,live,delegate與one方法的用法及區(qū)別進行了詳細的介紹,需要的朋友可以過來參考下,希望對大家有所幫助2013-12-12jQuery插件ImgAreaSelect實現頭像上傳預覽和裁剪功能實例講解一
這篇文章主要介紹了jQuery插件ImgAreaSelect實現頭像上傳預覽和裁剪功能實例講解一,需要的朋友可以參考下2017-05-05jquery 之 $().hover(func1, funct2)使用方法
.hover(func1, func2) 的效果等效于: mouseenter(), mouseleave()2012-06-06