W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] Autofocus attribute

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 22 Aug 2004 12:20:52 +0000 (UTC)
Message-ID: <Pine.LNX.4.61.0408221219490.20869@dhalsim.dreamhost.com>
On Tue, 3 Aug 2004, Brian Wilson wrote:
> 
> I mean... Two form fields are in a document, one has the 
> autofocus="autofocus" attribute set, the other is given focus by the 
> focus() javascript method at body onLoad time. Which should have focus 
> when the document finishes loading? In other words, how does/should the 
> autofocus attribute figure in to the document loading event chain 
> chronology?

The spec says "When a form control is inserted into a document, the UA 
must check to see if it has this attribute set. If it does, and if the 
control is not disabled, then the UA should focus the control, as if the 
control's focus() method was invoked. (When multiple elements are 
simultaneously inserted into the document, they must all perform this, in 
document order.)".

Doesn't think answer the question?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 22 August 2004 05:20:52 UTC

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