jquery獲取li里面的第一個a標簽

$("li").children("a:eq(0)") ; children()查找子元素,eq() 查找第幾個 $('.active').children("a:eq(0)").attr("id"); 獲取class=active元素第一個a標簽的id ...

Wed May 24 02:16:00 CST 2017 0 9285
獲取一個<tr>中<td>的

$("#trId").children("td").eq(0).text(}; //當前行的第一個<td>的 <td>下標從0開始 $("#trId").next("tr").children("td").eq(0).text(}; //下一行中 ...

Sun Feb 04 00:11:00 CST 2018 0 1951
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM