jquery:how to get the id of anchor tag
- by balalakshmi
I have 2 anchor tags
<li><a id="tab1" href="#tabs-1">Issue</a></li>
<li><a id="tab2" href="#tabs-2">Change Request</a></li>
I have the following jquery:
$('a').click(function(event) {
alert($('a').attr("id"));
});
What happens:
I always get "tab1" in the pop up
What I need:
when user clicks on an anchor tag, its id needs to be displayed in the pop up