Learn Accessibility by Building a Quiz - Step 30

I ran your HTML through the validator and this is what I got:

  • Error: An img element must have an alt attribute, except under certain conditions.

This is actually a legitimate error and I would consider it a bug in the course. I’ll probably create an issue for this. Especially since this course is about accessibility and this is an accessibility related bug :slight_smile: But you can ignore it. This isn’t affecting your ability to pass this step.

  • Three warnings about an unnecessary region role on the section element.

This is true, you don’t need to explicitly specify the role since the sections are given an accessible name (via the aria-labelledby attribute). But it’s just a warning and it is not an accessibility issue to have the role attribute there. In general, you can ignore warnings produced by the validator.

  • Error: Stray end tag label.

This sounds like it might be something you want to look at. It’s telling you that you have one too many closing </label> tags. It even highlights where it is below the validation message.

thanks for looking at it. so, to confirm - I look at the stray end tags and that may be stopping the step from passing and creating that error? is what I have inputted to date if I fixed the errors ok?

Yes, that stray </label> tag is definitely keeping you from passing this step. Also, I am now noticing that you have done more than the instructions for step 30 asked you to do. For example, you have added label text. And you have moved the closing </label> tags.

I am going to go back to my previous recommendation. Restart the step to get the original HTML back and then only do exactly what the instructions ask for and no more. Take the instructions very literally. They are only asking you to do two things:

  • Add a for attribute to each label
  • Add a corresponding id attribute to each input to link it to the label

That’s it. If you are changing anything else you are doing it wrong :slight_smile: I know that you know that there should be label text in the labels. That will come in the next step. Don’t anticipate. Just make the tests happy by only doing what is asked and no more.

1 Like

thank you for the feedback. I really appreciate this. I will do that. :slight_smile:

I know the rules are only to do a heart or solution button yet THANK YOU! hours later I figured it out. Your helpful explanation was the reason I finally understood what to do. Thank you for taking the time !

there is no such rule, don’t worry

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