Opeyemi
@opeyemi-codeAll comments
- @AmrAdel01Submitted about 2 years ago@opeyemi-codePosted about 2 years ago
Firstly, I'd like to congratulate you on taking part in this challenge. However, some issues need to be fixed in your work. I'd like to make some contributions regarding the challenge: *For the ratings, I'll suggest that you put them in a li element instead of a button. *For the selected number create a span element and an id that will hold the selected number. *for the Javascript side, create a global variable with the keyword 'let' and assign a value of zero to It. *To get the number that was selected, loop through the list items using a forEach array method and add an event listener to each one of them. After doing that pass the event (e) method as a parameter in that function, then use the e.currentTarget.textContent to get the value of the selected item and store it in the variable that was created earlier. Ex. Assume that the variable you created was named count. count = e.currentTarget.textContent; *After that, attach an event listener to the submit button. Inside the submit button, pass the value of the variable that holds the number to the span element that was created in the HTML file. I hope this will help. Good luck with it.
1