Re: LABEL behaviour

On Thu, Oct 09, 2003 at 01:19:33PM +0000, Ian Hickson wrote: 
| On Thu, 9 Oct 2003, [KOI8-R] ????????? ????? wrote:
| >
| > Now LABEL distribute only Click event
| > (http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL), but i see
| > no reasons why HTML shouldn't handle mouseOver event.
| 
| A label does not "distribute click events", it merely passes focus to its
| control when it is focussed. It does not matter exactly _how_ the label is
| focussed.

Or, to put it another way, it has a default onfocus event attribute of:

document.getElementById(this.for).focus();

Of course, the browser implements this internally, so it will work even 
if scripting is unsupported or disabled.

My DOM and ECMAScript are a little rusty, but I think thats right.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

Received on Thursday, 9 October 2003 09:38:25 UTC