@umairanwer
Posted
Hi, the issue arises because when you revert the styles using js, the styles of the pseudo classes (:hover) are also set to these styles, thus your hover action stops working. Although you coded the hover effect again using js but a simpler solution is that to reset styles of deselected items by setting their style properties to empty string in js, this way the original css styles will take effect.
ratelist[y].style.backgroundColor = "";
ratelist[y].style.color = "";
Now you can remove the hover effect code from js and your page will function as intended.
Marked as helpful