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 8022585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:18:20+00:00 2026-06-04T22:18:20+00:00

Possible Duplicate: What is the For attribute for in an HTML tag? I have

  • 0

Possible Duplicate:
What is the For attribute for in an HTML tag?

I have been trying to find this out. What is the reason for using the “for=” when you use a label in HTML?

<form>
  <label for="male">Male</label>
  <input type="radio" name="sex" id="male" />
  <br />
  <label for="female">Female</label>
  <input type="radio" name="sex" id="female" />
</form>

If it’s needed then is there some equivalent in HTML 5 or is it the same?

  • 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. Editorial Team
    Editorial Team
    2026-06-04T22:18:21+00:00Added an answer on June 4, 2026 at 10:18 pm

    It makes a click on the label focus the input element it is for.

    In the example you posted, you simply click on the word Male or the radio button in order for it to get selected. Without this, you have a much smaller target to click…

    If it’s needed then is there some equivalent in HTML 5 or is it the same?

    It is not required, but is good practice for labels that have a direct form element to focus on (it wouldn’t make much sense for a label that doesn’t have a counterpart on a form).

    The syntax is the same for HTML 5.

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

Sidebar

Related Questions

Possible Duplicate: remove attribute of html tag I have some jQuery in my code
Possible Duplicate: How to access this attribute using jquery, given a div defined by
Possible Duplicate: jQuery attribute selector for multiple values I have this $('input:radio[name=foo]').change(function() { blah();
Possible Duplicate JavaScript: Changing src-attribute of a embed-tag but this is not working for
Possible Duplicate: Html validation error for property attribute According to facebook to use their
Possible Duplicate: Use created attribute with javascript in select list im trying to access
Possible Duplicate: php regexp: remove all attributes from an html tag $input = '<div
Possible Duplicate: What are valid values for the id attribute in HTML? Underscores seem
Possible Duplicate: Cast string to enum with enum attribute I have a enum like
Possible Duplicate: How to extract a node attribute from XML using PHP's DOM Parser

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.