I always try to do the following:
<label><input type="checkbox" /> Some text</label>
or
<label for="idOfField"><input type="checkbox" id="idOfField" /> Some text</label>
My question is related to the label tag, specifically on a checkbox.
Most websites (I would say >40%) don't use the <label>
tag.
Is there a reason for this? Is there a problem in a browser or some other issue?
Note: Incase people don't know about the <label>
tag, it has a number of advantages:
Note 2: Some people have mentioned that example #2 is more correct than #1 (above), but according to the documentation here, either is correct
I think it's probably more a factor that people don't know about the <label> tag. I didn't, until this post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With