Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 64243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:45:33+00:00 2026-05-10T18:45:33+00:00

I’ve never had a reason to put a label element inside of a legend

  • 0

I’ve never had a reason to put a label element inside of a legend element (never really thought about it or seen it done). But with the design I’m implementing, it’s tempting to do so.

Here’s what I’m tempted to do:

<fieldset> <legend><label for='formInfo'>I would like information on</label></legend> <select id='formInfo'>     <option value='Cats'>Cats</option>     <option value='Dogs'>Dogs</option>     <option value='Lolz'>Lolz</option> </select> </fieldset> 

It works as expected (clicking the label focuses the corresponding input) in Firefox3, Safari, Opera, and IE6/7 and it passes validation, but I’m just wondering if there are any known reasons (accessibility? semantics? browser issues) why this shouldn’t be done

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:45:34+00:00Added an answer on May 10, 2026 at 6:45 pm

    Where is your </fieldset>?

    Semantically, legend describes a fieldset, just as label describes a single field.

    Fieldsets are supposed to be used to group together semantically related fields (for instance, an ‘address’ fieldset might have input fields for street, city and country).

    Assuming you have more than one field in the fieldset, then doing what you suggest doesn’t semantically make sense — you need to create separate legend text that describes the fieldset, then a label for each field.

    If you only have one field, then you don’t need fieldset or legend at all.

    So, basically, you shouldn’t do what you’re doing.

    If you’re doing it to have extra elements to attach CSS rules or Javascript events to, you’re better off using generic elements like div and span that won’t confuse text-to-speech and other non-visual user agents.

    i.e., putting in a div or span is effectively neutral in terms of accessibility/semantics (it implies nothing) versus misusing a semantic element (even if only slightly, as in this case), which is potentially misleading. Imagine even the best-case scenario for your layout in a text-to-speech browser: The text is read aloud twice, once as legend and once as label — why would someone want the phrase ‘I would like information on’ read aloud twice to them? Especially as it only makes sense in the context of the choices in the select control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.