如何获取调用我的jquery的控件的ID? [英] How can I get the Control's id from which my jquery is called?

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

问题描述

我有几个单选按钮,并且已将jquery附加到这些单选按钮上.
当我调用我的jquery时,我想要从中调用该jquery的控件的ID.

我尝试了以下技术:

I have several radiobuttons and I have attached my jquery to these radio buttons.
When I call my jquery I want the control''s id from which this jquery was called.

I have tried the following technique:

$(this).attr(''id'');


但是失败了.

如何获取控件ID?
谢谢


But it failed.

How can I get the controls id?
Thank you

推荐答案

(this).attr(''id'');
(this).attr(''id'');


但是失败了.

如何获取控件ID?
谢谢


But it failed.

How can I get the controls id?
Thank you


确保您的属性名称正确.在ASP.NET中,它几乎总是"ID"而不是"id".
Make sure that your attribute name is the proper case. In ASP.NET, it''s almost always "ID" as opposed to "id".


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

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