Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    </>HTML

    Document foundations

    • What is HTML?
    • Metadata and language
    • Attributes and character references
    • Headings, paragraphs and formatting

    Content and media

    • Links
    • Images
    • Lists
    • Tables
    • Responsive images and media

    Forms

    • Forms and inputs
    • Grouping form controls
    • Form validation and submission

    Structure and accessibility

    • Semantic HTML
    • Keyboard and screen-reader access
    • Disclosure with details
    • Project: your profile page
    HTML

    Forms · Lesson 11 of 16

    Grouping form controls

    radio, select, textarea and fieldset.

    8 minutes2 games

    Radio inputs sharing a name form a single-choice group; checkboxes represent independent choices. fieldset groups related fields and legend names the group. Use select for options and textarea for longer text.

    HTML
    <form>
      <fieldset>
        <legend>Study mode</legend>
        <label><input type="radio" name="mode" value="online" checked> Online</label>
        <label><input type="radio" name="mode" value="campus"> Campus</label>
      </fieldset>
      <label for="level">Level</label>
      <select id="level" name="level"><option value="beginner">Beginner</option><option value="advanced">Advanced</option></select>
      <label for="notes">Notes</label>
      <textarea id="notes" name="notes" rows="3"></textarea>
      <button type="submit">Apply</button>
    </form>

    fieldset groups

    legend names

    label describes each choice

    Important

    Radios in a group share a name and have distinct values. Any ids must remain unique.

    Interview question

    Which value is submitted from a select?

    Complete the code

    Complete the group label.

    <fieldset>
      <>Contact preference</>
    </fieldset>

    Exercise

    Create a select named level linked to a label, with two options.

    HTML

    Learn more from

    • MDN: HTML referencedeveloper.mozilla.org
    • web.dev: formsweb.dev

    Played 0 of 2 games

    Sign in to save your progress and earn XP.

    PreviousForms and inputsNextForm validation and submission
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.