码迷,mamicode.com
首页 > Web开发 > 详细

jQuery 选中tr下面的第某个td

时间:2017-06-01 18:41:24      阅读:607      评论:0      收藏:0      [点我收藏+]

标签:rtt   layui   http   nbsp   点距   head   html   char   span   

想实现的功能:点击 tr ,获取该tr 下的第一个td标签下的< input type="hidden" value="92"/> value值。

贴出HTML代码:

 1 <table class="layui-table" id="alertTable" style="margin: 0 auto; width: 100%;">
 2     <thead>
 3         <tr>
 4           <th>日期</th>
 5           <th>经度</th>
 6           <th>纬度</th>
 7           <th>距最近点距离</th>
 8         </tr>
 9     </thead>
10     <tbody>
11         <tr class="alertChart">
12            <td>
13                <input type="hidden" value="92" />2017-06-01 16:57:25</td>
14            <td>110.23568</td>
15            <td>125.23564</td>
16            <td>25.2m</td>
17         </tr>
18     </tbody>
19 </table>

 

贴出js代码:

1 $(.alertChart).dblclick(function(){
2        alert( $(this).children(td).eq(0).children(input).val() ) ;
3 });

 

显示结果:

技术分享

 

jQuery 选中tr下面的第某个td

标签:rtt   layui   http   nbsp   点距   head   html   char   span   

原文地址:http://www.cnblogs.com/eager/p/6930088.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!