Q:

How to add onClick event to an a tag with class

Here's what I have on a page
<a class="download-link" href="http://www.test.com/pages-">Pages 1</a>

Below is the Result I want to achieve with jQuery. 
<a class="download-link" href="http://www.test.com/pages-1.asp" onclick="_sz.push(['event', 'PDF', 'download', ('report') ])">Pages 1</a>

jQuery
<script type="text/javascript">/
$('.download-link').each(function(){
    this.href += '-1.asp';
    this.attr('onclick', '_sz.push(['event', 'PDF', 'download-request', ('report') ])');
})
</script>

A:

try this one.
$('.download-link').bind('click', function (event) {
    _sz.push(['event', 'PDF', 'download', ('report')])
});

I hope. It helps you.

