KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How to get the id of an anchor tag in jQuery? This is the tag. <ul class="formfield"> <li class="selected"><a href="" id="text">Text</a></li> <li><a href="" id="textarea">Textarea</a></li> </ul> I need to get the id, i.e., textarea,text etc in a variable. I tried something like this,but there is no such thing as fieldValue I suppose. $('.formfield a').click(function() { fieldType=$('.formfield a').fieldValue(); alert(fieldType); });
Tags (comma-separated)
Save Edits
Cancel