Wrapping radio buttons in a fieldset Element can be wrongly circumvented

Tell us what’s happening:

While I was solving a specific Applied Accessibility course, I saw it could be passed with wrong code. The instructions tell me to replace a specific <p> element (located around the text asking what level ninja a user is) with a <legend> one, but if I were to replace an unrelated <p> element above instead, it would still seem right to the checker.

It may have been done on purpose, since there’s an hint text that tell the user where to start changing code. However, I’d like to tell you about this anyway. Thank you in advance.

The wrongly (but right, according to the checker) written code is the next one:

  **Your code so far**

  <h1>Deep Thoughts with Master Camper Cat</h1>
    <legend>Sign up to receive Camper Cat's blog posts by email here!</legend>
    <label for="email">Email:</label>
    <input type="text" id="email" name="email">

    <!-- Only change code below this line -->
      <p>What level ninja are you?</p>
      <input id="newbie" type="radio" name="levels" value="newbie">
      <label for="newbie">Newbie Kitten</label><br>
      <input id="intermediate" type="radio" name="levels" value="intermediate">
      <label for="intermediate">Developing Student</label><br>
      <input id="master" type="radio" name="levels" value="master">
      <label for="master">Master</label>
    <!-- Only change code above this line -->

    <input type="submit" name="submit" value="Submit">
  <h2>The Garfield Files: Lasagna as Training Fuel?</h2>
  <p>The internet is littered with varying opinions on nutritional paradigms, from catnip paleo to hairball cleanses. But let's turn our attention to an often overlooked fitness fuel, and examine the protein-carb-NOM trifecta that is lasagna...</p>
<img src="samuraiSwords.jpeg" alt="">
  <h2>Defeating your Foe: the Red Dot is Ours!</h2>
  <p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightning speed. But chin up, fellow fighters, our time for victory may soon be near...</p>
<img src="samuraiSwords.jpeg" alt="">
  <h2>Is Chuck Norris a Cat Person?</h2>
  <p>Chuck Norris is widely regarded as the premier martial artist on the planet, and it's a complete coincidence anyone who disagrees with this fact mysteriously disappears soon after. But the real question is, is he a cat person?...</p>
<footer>&copy; 2018 Camper Cat</footer>
  **Your browser information:**

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0

Challenge: Wrap Radio Buttons in a fieldset Element for Better Accessibility

Link to the challenge:

The test doesn’t check the specific location of the legend element, just that there is one.

assert($('legend').length == 1);

Not sure how much it really matters but it would be possible to test the content of the element to see if the correct p element was replaced.

If you want, you can open an issue, although there is a code freeze in effect right now.

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

1 Like

Hi, Lasjorg.
Thank you for your answer. You’ve helped me understand how do course tests work. I’ll take your suggestion into account. :grinning:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.