W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2006

[whatwg] Return values of on* event handlers

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Sun, 23 Jul 2006 12:41:55 -0500
Message-ID: <44C3B4E3.4040901@mit.edu>
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?

That is, does the return value of the onclick handler cancel the event if it's 
== to false, or only if it's === to false?

In shipping Geckos it only cancels if the return value === false; I suspect 
other browsers behave similarly but it could use testing.

-Boris
Received on Sunday, 23 July 2006 10:41:55 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:47 UTC