Class toggle delete other class

So… I have a button class “btn-light” and when a condition is correct it should delete it and apply a “btn-success” class, the problem is that the class isn’t replace but added to the element. I need to replace the “btn-light” for “btn-success”.

This is the conditional:
image

Community Page
Last updated: