How can I get to know which anchor tag got clicked?
<p>I am creating my content dynamically, When a anchor tag is clicked <code>navigate()</code> function is called. How can i determine which <strong>anchor</strong> tag was clicked?</p>

<pre><code>    function navigate()
    {
        //var location=$(this).attr("id");
        switch(location)
        {
            /*case "Configuration":     $('#detailTable').empty();
                                    $('#detailTable').append(navigateConfig);
            break;*/

            default: alert(location+" a tag was clicked");
        }
    }

    $('#detailTable').empty();
    $('&lt;div width="100%"&gt;')
    .attr('id','javainfoSpan')
    .html('&lt;div class="titleBlue"&gt;&lt;a href="javascript:navigate();"&gt;Configuration&lt;/a&gt;&amp;gt;'+productname+'&amp;gt;Java Properties&lt;/div&gt;'+
            //some other stuff
        '&lt;/div&gt;')       
    .appendTo('#detailTable');
</code></pre>

<p><strong>Update:</strong> </p>

<p>My question is simple</p>

<ol>
<li>there will be a number of <code>a</code> elements inside <code>detailTable</code>.</li>
<li>how can I get to know in some js function, which <code>a</code> element was clicked?</li>
</ol>
