Welcome to the Treehouse Community
Looking to learn something new?
Michael Bran1,687 Points
Is there any reason why simply using an h tag to do this wouldnt work just as well? <h3>Name:</h3>
Just wondering if there is some reason to use label over h3 (or any H)? What are the advantages or disadvantages to different approaches?
Edit: I understand you can "click" the label, but if you have to click, you might as well click the form box itself since thats where you have to type. I've never clicked labels in 20+ years of using computers, only ever in the box. Is this normal user behavior? Plus there must be a way to auto-focus the cursor which would be the most user friendly for devices without a mouse, though I have no clue how that would be done.
Kevin Gates14,855 Points
Accessibility. Labels are used in conjunction with inputs and therefore provide onscreen assistance for those who need it. Headers are more like brief summaries of the next section of content.
Gabriel Pierce-Lackey11,014 Points
I think one of the main draws of labels over headers is that you can attach or group a label with an input using the for attribute, vs having to do more work than you need to do to group them together.