JQuery Determine if control is asp:label

jamesdean666
jamesdean666 used Ask the Experts™
on
I know I can use the JQuery to determine if a control is a textbox with the following code (.click):

if ($(this).is(':text')) {
   Do Something....
}

How can I detect an asp:label?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Multitechnician
Top Expert 2014
Commented:
check example on this page : http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.supportsdisabledattribute.aspx

http://www.mkyong.com/jquery/jquery-how-to-get-the-tag-name/
http://stackoverflow.com/questions/411688/how-to-extend-jquery-to-make-it-easier-to-retrieve-the-tagname

if( $(this).get(0).tagName.toLowerCase() == "span" ) {
   //Do Something....
}

Open in new window

Author

Commented:
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial