I have an external js file which I am creating a tag in.
Problem is I don't know how to use the quotes if I am to add an onclick event to the code below.
Now this code works:
banner_div.innerHTML = '<a href=\"'+links[counter]+'\"><img src=\"'+images[counter]+'\" border=\"1px\" style=\"border-color:#000;\" alt=\"'+alts[counter]+'\" title=\"'+titles[counter]+'\"></a>';
But I need to add this to the above:
onclick="_gaq.push(['_trackEvent', 'Link Clicks', 'From Index.html', 'www.domain.com']);"
How should I insert the onclick event to the first piece of code so it works?
Thanks
BTW: The arrays above are iterated inside a for loop. So for example links[counter] contains the current index of the links array, which could be for example "www.somedomain.com".