[thelist] form label tag

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


> Ah, so the input has to be INSIDE the label, so I can't use them on
> separate rows right? It must be <label for="1">One<input type="text"
> id="1" name="1"></label>
>
> is that correct?

No.

(That is, your example is perfectly good html; just not your thinking):

    <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" />

is perfectly valid, too -- in fact, that's what the 'for' attr is for --
when the relevant input *isn't* a child of the label, <label>'s 'for' says,
well, what the <label>'s a label for. . .


j

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

Success is getting what you want;
happiness is wanting what you get.




More information about the thelist mailing list