I want to change rating button's color when it is clicked. But JQuery code is not working.enter image description here
$(".vote").on("click",function(){
alert("a"); //test
$(this).css("backgroundColor","hsl(216, 12%, 54%)");
});
<div class="rating">
<button class="vote">1</button>
<button class="vote">2</button>
<button class="vote">3</button>
<button class="vote">4</button>
<button class="vote">5</button>
</div>