[thelist] form label tag

Jonathon Isaac Swiderski jswiders at cs.oberlin.edu
Thu Sep 12 18:00:01 CDT 2002


> >     <label>One<input type="text" id="1" name="1" /></label>
> >
> > is perfectly good html.  But
> >
> >     <label for="1">One</label><br />
> >     <input type="text" id="1" name="1" />
>
>     But remember that ids must _not_ begin with a digit.

I hadn't considered that, but really, I was just using the example that
came in the questioner's message. . .

>     Also, with regard to nesting form elements within a label element, it
> _is_ valid, as you and others have said, but nesting is intended to create
> an implicit relationship between the label element and its associated form
> element

which is why you'll notice that I included no 'for' on the label in which
the input was nested, while I did include one in the one where they were
separated.  (I probably could have been more explicit about this, I admit).



--
Jonathon Isaac Swiderski \\ dangercat-20 at dangercat.net
cs.oberlin.edu/~jswiders  \\  www.dangercat.net/?id=mt

I'm really easy to get along with,
once people learn to worship me.




More information about the thelist mailing list