DEV Community

Marios T.
Marios T.

Posted on

How do I change the state of sibling items on button press?


I'm trying to inverse the status of each button text.

Here's what I'm trying to do:

By default "red" is on and the others are "off".

I want when I press on "green" red and blue to be off.

I don't know how to do this in both JS and React.


Top comments (0)