[whatwg] Return values of on* event handlers

Boris Zbarsky wrote:
> Consider the following testcase:
> 
> <!DOCTYPE html>
> <a href="http://www.example.com" onclick="return 0">Click me</a>
> 
> Should clicking the link load www.example.com?
> 

Yes. You should explicitly return "false" to cancel an event.

Most event handlers return nothing (undefined) which is equivalent to 
false. So equivalence is not good enough.

-dean

Received on Sunday, 23 July 2006 14:37:20 UTC