1
I have the following situation where I want to add a class and remove the rest from the 1
<div class="voted rating-box color ">
</div>
this and the html where div has 3 class when executing the function I want to remove all classes plus leaving to 1 and adding the class star would look like this
<div class="voted star ">
</div>
$(".voted").removeClass().addClass('star');
thanks worked out it was so easy .
– diogo Dsa