I’ve a problem to get the id of dynamically loaded anchor appended to a div. Here is the code that I get after filling the div:
<div id="sotto_eti">
<a href="#" id="a">a</a> <a href="#" id="b">b</a> <a href="#" id="c">c</a>
</div>
and here is the script:
<script>
$("#sotto_eti a").click(function()
{
alert($(this).attr("id"));
});
</script>
Thanks in advance for your help
ciao h.
if you would retrieve the ID of a links added dynamically, you should use the live function instead :