Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive Rating Component + simple SVG animation

@murilomcabral

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


πŸ“ŒPlease, feel free to leave a comment with tips so I can do it better.

Thank you for visiting!🀘

Community feedback

Abdul Khaliq πŸš€β€’ 72,640

@0xabdulkhaliq

Posted

Hello there πŸ‘‹. Congratulations on successfully completing the challenge! πŸŽ‰

  • I have other recommendations regarding your code that I believe will be of great interest to you.

HTML 🏷️:

  • This solution may cause accessibility errors due to lack of semantic markup, which causes lacking of landmark for a webpage and allows accessibility issues to screen readers, due to accessibility errors our website may not reach its intended audience, face legal consequences, and have poor search engine rankings, highlighting the importance of ensuring accessibility and avoiding errors.
  • The section element is not meant to use here, because it cannot define landmark of a webpage
  • What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like <div> or <span>. They are use to provide a more precise detail of the structure of our webpage to the browser or screen readers
  • For example:
  • The <main> element should include all content directly related to the page's main idea, so there should only be one per page
  • The <footer> typically contains information about the author of the section, copyright data or links to related documents.
  • So resolve the issue by wrapping the both <section> elements with the proper semantic element <main> in your index.html file to improve accessibility and organization of your page

.

I hope you find this helpful πŸ˜„ Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

0

@VCarames

Posted

Hey there! πŸ‘‹ Here are some suggestions to help improve your code:

  • Every site should ALWAYS have βœ… a main element not only for semantic purposes but also to help assistive technology find the main content of your content. For this challenge, it will serves as the component’s container ⚠️.

More Info: πŸ“š

MDN Main Element

  • The HTML for the ratings needs to be rewritten as it was done incorrectly ❌:

To ensure that the "rating buttons" are fully accessible πŸ’―, they need to be built using a form ⚠️.

  1. Everything will be wrapped inside a fieldset which will have a legend that is visually hidden using CSS.
  2. Inside, there should be five input radios and each input should have a label attached to it to make the β€œratings” accessible.
  3. The last thing you will want to include will be a button so users can submit their choice.

More Info: πŸ“š

MDN: Form Element

MDN: <input type="radio">

MDN: Field Set Element

  • Once the top is implemented , for your JS, the eventListener should be on the form as a submit.

More Info:πŸ“š

Click vs. Submit EventListeners

If you have any questions or need further clarification, feel free to reach out to me.

Happy Coding! πŸ‘Ύ

Marked as helpful

0

@murilomcabral

Posted

Hi, @vcarames! Made some improvements and corrections. If you could, please, see if now it is correct.

1

@VCarames

Posted

@murilomcabral

It looks better! But the form should only be wrapping the rating buttons only. So it should looking like this; form > fieldset > legend > (radios + labels 5x).

Marked as helpful

1

Please log in to post a comment

Log in with GitHub
Discord logo

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