Is there a simpler way to build the record rating function? I've made five separate functions, but I wonder if it's possible to combine these?
Eji Cyril Arinze
@Cyril-ArinzeAll comments
- @samantha-fluxSubmitted over 2 years ago@Cyril-ArinzePosted over 2 years ago
Hello, Samantha, Congratulation on completing this challenge. Now, Based on your question. you can simplify your code by placing a click event listener on all your rating button with the class = "rating". Then use the "this.id" keyword to get the id of the clicked button. you can the pass the id when the submit button is clicked.
if you find my comment helpful, do mark it as helpful
Marked as helpful0 - @TomiwayrnSubmitted over 2 years ago@Cyril-ArinzePosted over 2 years ago
Hello Tomiwa, Kudos, Your design, and functionality are great. However, your HTML has some validation and accessibility issues, notably are:
- no landmark
- no alternate text for images
- no labels for form elements.
To overcome these issues;
- for landmark-related issues: use header tags to indicate the head section of your page, main tags to display the actual content of the page, and footer tags for the footer.
- img tags take alternate text as a fallback or backup in case the image doesn't load due to errors, to achieve this, add ' alt="image-name" ' to your opening image tags. alternate text is also helpful for user who is accessing your webpage using a screenreader
- all form inputs elements should have a label that takes the attribute "for" whose value corresponds with the id of the input element it represents.
if you found my response helpful, do mark them as helpful
Marked as helpful0 - @fausto-machavaSubmitted over 2 years ago
The main problem I had during the development was the mobile version.
@Cyril-ArinzePosted over 2 years agoTo overcome the challenge you had, try using mobile first approach. In my believe, mobile first approach is the industry standard and it also makes your website mobile friendly. Again you can use media queries for specific screen sizes to make a different design. You can read more on media queries in MDN documentation or W3schools. If you found this comment helpful, do well to mark it as helpful
Marked as helpful0 - @HassanatB-OSubmitted over 2 years ago@Cyril-ArinzePosted over 2 years ago
in Html, IDs are unique and should appear once in the markup, if you need multiple elements having the same means of identification use classes instead of id. Do mark this as useful, if you found my response useful
Marked as helpful0 - @Ram0O7Submitted over 2 years ago
Can anyone explain the DOM used for rating update?
@Cyril-ArinzePosted over 2 years agoin Html, IDs are unique and should appear once in the markup, if you need multiple elements having the same means of identification use classes instead of id
0 - @ssj24Submitted over 2 years ago@Cyril-ArinzePosted over 2 years ago
The app is pretty not working. You should look into updating your solution
Marked as helpful0