Label wrapped around radio/checkbox compatibility?

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-04-12T00:14:16Z Indexed on 2010/04/12 0:23 UTC
Read the original article Hit count: 645

Filed under:
|

I noticed that if you wrap a radio button or checkbox in a label, the whole thing becomes clickable, even without a for/id pair (in fact, it seems to ignore this because I screwed it up!)

Example:

<label><input type="checkbox"> some text</label>

Then "some text" becomes clickable to check the box. I tested it in FF, Chrome and Opera, and IE8, does anyone know if it works in older browsers, like IE6?

© Stack Overflow or respective owner

Related posts about html

Related posts about browser-compatibility