如何使用jQuery获取Html表的第一行最后一列 [英] How to get the first row's last column of an Html table using jQuery

查看:74
本文介绍了如何使用jQuery获取Html表的第一行最后一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html表格,我需要得到第一行(这不是thead part.It将在tbody部分)最后一列值或文本。我需要点击按钮 btnAdd

I have a html table and I need to get the first row's (which is not the thead part.It will be in tbody part) last columns value or text. I need the value on clicking the button btnAdd

 <table>
    <thead>
    <tr>
    <td>Name</td>
    <td>ID</td>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>Edwin</td>
    <td><span style='display:none'>1</span></td>
    </tr>
    </tbody>
    </table>
   <input type='btnAdd' runat='server' >


推荐答案

$('table tbody tr:first td:last').text()

这篇关于如何使用jQuery获取Html表的第一行最后一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆