Prepending to an existing onclick
I have a link with an onclick on it
<a href="/home" onclick="old_foo()">Home</a>
I want the original onclick to fire "old_foo()" in addition to a new function "new_foo()"
Doesn't work, only fires new_foo() when the link is clicked
$(this).click(function() {
new_foo();
});
Doesn't work
$(this).click(function() {
$(this).attr('onclick');
new_foo();
});
What am I doing wrong?