如何使用jquery获取标签值 [英] how to get label value using jquery

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

问题描述

嗨朋友们,

我有以下列的gridview

Hi friends,
I have gridview with following columns

1. SrNo(Label)<br />
.<br />
.<br />
.<br />
5. Delete(HyperLink)





当用户点击删除时,我想得到标签SrNo的值。



我试过以下



When user clicks on the Delete, I want to the get the value of the label SrNo.

I tried following

$(document).ready(function(){
    $(''#btnDelete'').live(''click'',function(){
        var value = $(this).siblings(''#lblSrNo'').text(); 
        alert(value) ;
    });
});







但是上面的代码并没有吵闹。



谁能说出我要去哪里?



提前致谢




But above code does not wokrs.

Can anyone tell where I''m going worng??

Thanks in advance

推荐答案

(document).ready(function(){
(document).ready(function(){


(''#btnDelete'')。live(''click'', function(){
var value =
(''#btnDelete'').live(''click'',function(){ var value =


(this).siblings(''#lblSrNo'')。text();
alert(value);
});
});
(this).siblings(''#lblSrNo'').text(); alert(value) ; }); });







但是上面的代码并没有吵闹。



有谁可以告诉我'''我要去吗?



提前致谢




But above code does not wokrs.

Can anyone tell where I''m going worng??

Thanks in advance


这篇关于如何使用jquery获取标签值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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