Gene9y Gene9y - 1 year ago 175
jQuery Question

Get an id of the active a link

I am trying to get the id of the activated link of a element.

<div class="tabs">
<a class="title active" id="tab-1"></a>
<a class="title" id="tab-2"></a>
<a class="title" id="tab-3"></a>
<div id="close"></div>

$('#close').click(function() {

The alert returns 'undefined'. What's not right with this?

Answer Source

Try like this

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download