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 card

Youness 160

@younessbarahou

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


What specific areas of your project would you like help with?

Is it the shortest way to add these fonctionnalities to the website with js?

Community feedback

P

@cdanderson76

Posted

Nice work on the project, and I like what you did with the color there. I started off this project the same as you, and in the process, I learned a couple of things:

They always say write 'DRY' code: 'don't repeat yourself'. So while this works fine, there's a consistent repetition of the functions that you have there. Also, with extra '.html' file, there is an additional request sent to the 'server' to grab that page as well, which could cause performance issues .

You could use string template literals to make this work, and write out your code in JavaScript. Check out my code here: https://github.com/cdanderson76/interactiveRatingComponent/blob/main/script.js

See how it looks like HTML? That's what renders the second page. I hope that this helps!

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