W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2009

[whatwg] boolean attributes in javascript

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 8 Dec 2009 15:57:47 -0600
Message-ID: <dd0fbad0912081357i47ae0046l7a5db218036b4984@mail.gmail.com>
On Tue, Dec 8, 2009 at 3:48 PM, Brian Kuhn <bnkuhn at gmail.com> wrote:
>>??but it's invalid to set it to anything other than the two?values I just
>> mentioned.
>
> That's the part I'd like to see changed. ?I understand that if it's present,
> it's on. ?So, why can't async="true" be valid? ?I think all browser vendors
> will implement it that way anyway. ?They'd be crazy not to.

Indeed, async="true" does set it to be on.  However, so does
async="false", async="off", async="no", and any other string you can
think of that might imply that it's turned off.  Setting it to *any*
value turns it on, so it's best to avoid values that would lead to
confusing results.  The two values that are currently valid are the
minimum necessary, and neither have antonyms that would confuse
people.

~TJ
Received on Tuesday, 8 December 2009 13:57:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:54 UTC