restructured
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
stars.forEach((star, index) => {
|
stars.forEach((star, index) => {
|
||||||
star.starValue = (index + 1);
|
star.starValue = (index + 1);
|
||||||
star.addEventListener("click", starRate);
|
star.addEventListener("click", starRate);
|
||||||
})
|
});
|
||||||
function starRate(e) {
|
function starRate(e) {
|
||||||
output.innerHTML = `You Rated this ${e.target.starValue} stars`;
|
output.innerHTML = `You Rated this ${e.target.starValue} stars`;
|
||||||
stars.forEach((star, index) => {
|
stars.forEach((star, index) => {
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
} else {
|
} else {
|
||||||
star.classList.remove("orange");
|
star.classList.remove("orange");
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user