tags:

views:

27

answers:

2

Is it valid to have an input element within a label element to associate the input with the label? Example:

<label>Email Address: <input name="email" type="text" /></label>

Will major browsers associate the label and input control, without the label's for attribute specified?

I've seen it done this way several times, but was wondering if this is kosher HTML.

+1  A: 

According to this, it looks like it's okay. Will test in major browsers...

Ronnie Overby
+3  A: 

http://stackoverflow.com/questions/774054/should-i-put-input-tag-inside-label-tag

Moin Zaman
Thanks. I swear I searched before posting, but didn't see that.
Ronnie Overby
Nice catch...+1
Braveyard