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

Hello,
Just use two dynamic classes:

dmx-class:btn-light="yourconditon == false"

and

dmx-class:btn-success="yourconditon == true"
2 Likes

GENIOUS!

Haha, it’s not really that genius :slight_smile: Just following the logic you need.

1 Like