Add class on click

I would like to add a class to an element when I click on the button.

  1. Define a variable and assign a value, say 0
  2. Add the class to then element using dynamic attributes conditionally on variable value being another value, say 1
  3. In dynamic events of the button, toggle the variable value to 1 which will activate the class
2 Likes
2 Likes

thanks, all done!