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

Harleen Kaur• 40

@harleenkaur1343

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


It would be really helpful if you could suggest an easier approch for making css hover work after the javascript click event is executed on rating?

Community feedback

Umair• 240

@umairanwer

Posted

Hi, the issue arises because when you revert the styles using js, the styles of the pseudo classes (:hover) are also set to these styles, thus your hover action stops working. Although you coded the hover effect again using js but a simpler solution is that to reset styles of deselected items by setting their style properties to empty string in js, this way the original css styles will take effect.

ratelist[y].style.backgroundColor = "";
ratelist[y].style.color = "";

Now you can remove the hover effect code from js and your page will function as intended.

Marked as helpful

0
Abdul• 8,560

@Samadeen

Posted

Hey!! Cheers 🥂 on completing this challenge.. .

Here are my suggestions..

  • You should use <main class="rating"> instead of <div class="rating">.
  • Go down orderly when you are using the headings h1 down to h2 down to h3 and so on.
  • You can wrap your attribution section in a footer tag to avoid accessibility issues.
  • You should add a alt text to your img tag to aid screen-readers

This should fix most of your accessibility issues

. Regardless you did amazing... hope you find this useful... Happy coding!!!

Marked as helpful

0

Harleen Kaur• 40

@harleenkaur1343

Posted

@Samadeen Thanks Abdul, would definitely implement them from now on..

0

@FahimEcho

Posted

great work harleen..keep up your practice.all the best

0

Harleen Kaur• 40

@harleenkaur1343

Posted

@FahimEcho Thanks Sadman..

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