question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create a Set of Radio Buttons - Not Showing Best Practices

See original GitHub issue

In the Create a Set of Radio Buttons challenge of the HTML5 and CSS section (https://www.freecodecamp.org/challenges/create-a-set-of-radio-buttons), it states:

Here’s an example of a radio button:

<label><input type="radio" name="indoor-outdoor"> Indoor</label>

Yet, in more official Mozilla documentation (https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/How_to_structure_an_HTML_form#The_<label>_element), it states:

Note that a widget can be nested inside its <label> element, like so:

<label for="name">
  Name: <input type="text" id="name" name="user_name">
</label>

Even in such cases however, it is considered best practice to set the for attribute because some assistive technologies do not understand implicit relationships between labels and widgets.

This was discussed here: https://forum.freecodecamp.org/t/anyone-notice-that-some-of-the-challenges-dont-demonstrate-best-practices/151348

Please update the challenge to reflect best practices.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dhcodescommented, Oct 11, 2017

@darthgera123 the challenge code is here

You would need to update the instructions and the tests for this challenge, then update the instructions and tests for the checkbox challenge after, and update the code that is preloaded in the editor for every subsequent challenge.

@freeCodeCamp/moderators I’m fine with this change, but would like to hear others’ thoughts.

0reactions
raisedadeadcommented, Jan 9, 2018

Hi @yoizfefisch thanks for the feedback, please feel free to make a PR if you would be interested or create a separate issue for us to add these recomendations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a Set of Radio Buttons - Not Showing Best Practices
Even in such cases however, it is considered best practice to set the for attribute because some assistive technologies do not understand ...
Read more >
Basic HTML and HTML5: Create a Set of Radio Buttons
Think about an old jukebox when you are thinking of radio buttons. Radio buttons are a collection of buttons in which only one...
Read more >
How to Create Radio Buttons in HTML [+ Examples]
While using <label> isn't strictly necessary, it's considered a best practice for two reasons. First, the semantically rich <label> element ...
Read more >
HTML Radio Buttons best practices - Stack Overflow
1 Answer 1 · Best thing to do would be to change the names of each group to be unique. · Second best...
Read more >
Radio Button Guidelines | Wireframing Academy - Balsamiq
Radio button controls allow users to select items from a list when only a single selection is valid. Find out when you should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found