I have a dynamic carousel banner on my homepage (I have no control over the html expect I can add the href, image ref and I can add an id to the a link for each carousel banner) I can add an an event to the first carousel banner but not the others. I think it's because the html doesn't exist for the banners when the document is loaded execpt the first one as the carousel banner is dynamic and changes every couple of seconds. I've added an id to the second banner of testID and tried the below code:
$(document).ready(function(){
$('#testID').click(function(){
_gaq.push(['_trackEvent', 'cbanner', 'IDtest',$(this).attr('href'),0,true]);
});
});
But the onclick event is still not working.
Thanks