@DavidMorgade
Posted
Hey Joao Pedro, nice job finishing the challenge! congrats!
As harderth pointed out, if you submit with no selected value it just show 4, you can fix this in your Javascript adding a return alert()
if no rating button was clicked!.
In your code for example, you could use a check if the number is false like this:
submit.addEventListener("click", () => {
if(!number) return alert('Please select a rating button');
card.classList.add("active")
console.log(card)
card2.classList.add("active-2")
})
For making this to work you should first remove your hard-coded '4' in your html <span>
Hope my feedback helps you! great work!
Marked as helpful