I am trying to add an onClick event to an anchor tag ...
Previously i had ...
<a href=somlink.html onClick=pageTracker._link(this.href); return false;>
But i am trying to avoid the inline onClick event because it interferes with another script..
So using jQuery i am trying the following code ...
<script>
$(document).ready(function() {
$('a#tracked').attr('onClick').click(function() {window.onbeforeunload = null;
pageTracker._link(this.href);
return false;
});
});
</script>
with the html like so <a id=tracked href=something.html>
So my question is should this be working, and if not what would be the best solution?