Abdelrhman khalil aliā¢ 300
@abdelrhmanKh
Posted
Hi youngmelis, Your Design is Amazing.
##Hope to accept some advice about your js Code.
- You could use data-set on all the rating buttons or use the class rating to get a node of all buttons and use a loop to attach the same event without repeating the code to follow the concept don't repeat yourself.
- To get all elements I prefer using a query selector to get the wanted element My code is something like this.
for (const li of ratting) {
li.addEventListener("mouseover", () => {
for (const li of ratting) {
li.classList.remove("active")
}
li.classList.add("active")
}
)
}
- Hope You happy Coding
Marked as helpful
1