order of onclick events
- by NicoF
I want to add a jquery click event to href's that already have an onclick event.
In the example below the hard coded onclick event will get triggered first.
How can I reverse that?
<a class="whatever clickyGoal1" href="#" onclick="alert('trial game');">play trial</a>
<br />
<a class="whatever clickyGoal2" href="#" onclick="alert('real game');">real trial</a>
<p class="goal1">
</p>
<p class="goal2">
</p>
<script type="text/javascript">
$("a.clickyGoal1").click(function() {
$("p.goal1").append("trial button click goal is fired");//example
});
$("a.clickyGoal2").click(function() {
$("p.goal2").append("real button click goal is fired"); //example
});
</script>