title: Add code to onclick attribute of links
body: <p>I'd like to add a JavaScript code inside the <code>onclick</code> attribute of each link of a list. The code is used for google analytics event tracking. </p>
  
  <p>This is the list:</p>
  
  <pre><code>&lt;ol&gt;
      &lt;li&gt;
          &lt;a href=""&gt;Alberto Guardiani&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href=""&gt;Antica Bottega&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href=""&gt;Ash&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href=""&gt;Ballin&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ol&gt;
  </code></pre>
  
  <p>And this is what it should be like after the jquery appends the onclick code:</p>
  
  <pre><code>&lt;ol&gt;
      &lt;li&gt;
          &lt;a href="" onclick="_gaq.push(['_setCustomVar', 2, 'Designer', 'text1', 3]);"&gt;text1&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href="" onclick="_gaq.push(['_setCustomVar', 2, 'Designer', 'text2', 3]);"&gt;text2&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href="" onclick="_gaq.push(['_setCustomVar', 2, 'Designer', 'text3', 3]);"&gt;text3&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;a href="" onclick="_gaq.push(['_setCustomVar', 2, 'Designer', 'text4', 3]);"&gt;text4&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ol&gt;
  </code></pre>
  
  <p>I have no idea if that's even possible with jQuery <code>append</code> or what else should I do with this issue. Could you suggest some kind of solution?</p>