☆☆☆☆☆
let currentRating = 0;
function setRating(rating){
currentRating = rating;
document.getElementById("ratingValue").value = rating;
let stars = document.querySelectorAll("#starRating span");
stars.forEach((star, index) => {
if(index < rating){
star.textContent = "★";
star.style.color = "#ffb400";
} else {
star.textContent = "☆";
star.style.color = "#000";
}
});
}
function validateRating(){
if(currentRating === 0){
alert("Please select a rating");
return false;
}
return true;
}