Interesting problem today, I tried to override behaviour of an image. The simple approach of replacing behaviour obviously didn't work:
1 |
$("#game-image").click(function() { }); |
Neither $("#game-image").removeAttr('onclick');
did anything. There is a function unbind
.
1 |
$("#game-image").unbind('onclick'); |
This can be followed by the 'overriding' function:
1 |
$("#game-image").unbind('onclick').click(function() {return"asdf";}; |