Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

interactive-rating-component-main with oop and localStorage propertie

Christ Kevin Touga Watat•270
@Christ-Kevin
A solution to the Interactive rating component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I don't have a particular question concerning this project.

But I'm still open for every suggestions that can make me improve the user experience of this Web application. Every suggestions that can make me improve my coding skills is also welcome

Kind regards

Christ-Kevin

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Grace•32,130
    @grace-snow
    Posted over 2 years ago

    Hi

    I’m afraid the html on this needs updating a bit

    1. The star icon is decorative, therefore it’s alt text should be blank
    2. As the only contents in there is an image, that should not be a header element either. A header is a landmark element so should only be used outside of main and contain repeating content across a site (eg logo, nav)
    3. A nav is for navigation only. It is definitely not meant to hold a set of form inputs. Same with the ul and lis, they shouldn’t be used here. Those numbers should ideally be contained by a fieldset. I would recommend using aria-labelledby on that fieldset pointing to the id of the question, so it acts as a legend. And aria-describedby pointing to the id of the helper text.
    4. This should be a set of radio inputs, not a load of buttons. The expected UI for this has to be radios because you can only choose one from a set. At the moment, keyboard users would have unexpected controls, requiring them to tab when they should be able to use arrow keys; and screenreader users would have no indication as to what has been selected.
    5. Similar to above, the results section image is decorative so should not have filled alt text. Therefore it should not be in a figure element either.
    6. That means you shouldn’t be using figcaption. Just a title and the paragraphs in the thank you panel
    7. The thank you panel should not be an article. It is not a piece of content that could be syndicated on other sites, it is just a form submit status

    Overall the js on this is more complicated than it needs to be and most of that is just from using the wrong html elements. Default behaviour of a form with a set of radios inside would give you the chosen value to use and that one value is all you need js for (you chose X). As a general rule try to use js for as little as possible when native browser behaviour can do the heavy lifting

    Marked as helpful
  • Hyron•5,870
    @hyrongennike
    Posted almost 3 years ago

    Hi @Christ-Kevin,

    Congrats on finishing the challenge, just a few snags you can look at. The user is still able to submit even though no value was select which you can disable the submit button if no value was selected or you se the default value to 1 rather it being zero. You should only allow one rating number to have the selected state at the moment I'm able to select more than one rating number and the last would be to just look at the report and fix those errors by doing so your next challenge won't have them because you would know how to prevent them from occurring.

    Marked as helpful

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub