# How can I make (with interactions) so that when I click on one of the buttons, the background changes to red and from the other radio button the red background is removed (toggle)?

**URL:** https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940
**Category:** Beginners
**Created:** [October 22, 2024, 5:31pm UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940 "2024-10-22T17:31:18Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![creer](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@creer](https://forum.pinegrow.com/u/creer)
#### Post date: [October 22, 2024, 5:31pm UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940/1 "2024-10-22T17:31:19Z")

</div>

Hello!  
How can I make (with interactions) so that when I click on one of the buttons, the background changes to red and from the other radio button the red background is removed (toggle)? I tried using all the values from the advanced panel one by one, but I couldn’t find anything suitable.

 ![a72e744d353099855413ebc68ed876162d9cea6](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/0/0b4297fdb61de46795605d5abd4ab2794408ba0f.png)

---

<div class="post-metadata">

### Author: ![Riccarcharias](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/riccarcharias/32/4051_2.png) [@Riccarcharias](https://forum.pinegrow.com/u/Riccarcharias)
#### Post date: [October 23, 2024, 5:44am UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940/2 "2024-10-23T05:44:58Z")

</div>

You could use a click trigger in Interactions but that would also change the color then you click twice on a radio toggle without changing it’s value.

I would do this with Javascript (if(toggle.checked == true))

---

<div class="post-metadata">

### Author: ![creer](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@creer](https://forum.pinegrow.com/u/creer)
#### Post date: [October 23, 2024, 6:47am UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940/3 "2024-10-23T06:47:10Z")

</div>

Hi @Riccarcharias , thank you  
More specifically, I was trying to implement something like this from the video. Does it come out that I can’t implement this with interactions completely without resorting to writing javascript?

---

<div class="post-metadata">

### Author: ![PeteSharp](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/petesharp/32/7073_2.png) [@PeteSharp](https://forum.pinegrow.com/u/PeteSharp)
#### Post date: [October 23, 2024, 8:56am UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940/4 "2024-10-23T08:56:14Z")

</div>

I used some checkboxes for a project today in Bootstrap. This was a radio button group. Its much easier with a frame work, then you just use CSS.

 ![CleanShot 2024-10-23 at 21.51.13@2x](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/3/3f6d1f0d80805a2ac4a6b5db04f1e1db9c0160d0.jpeg)

---

<div class="post-metadata">

### Author: ![Riccarcharias](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/riccarcharias/32/4051_2.png) [@Riccarcharias](https://forum.pinegrow.com/u/Riccarcharias)
#### Post date: [October 24, 2024, 6:13am UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940/5 "2024-10-24T06:13:35Z")

</div>

I don’t think that you can achieve this in Pinegrow Interactions. But maybe you don’t need Javascript, maybe you can do this with CSS alone.

Try input[type=radio]:checked as a CSS selector with which you can style how the checked version of your radio button should look like. use “transition: 0.5s” for the smooth change effect.

---

<div class="post-metadata">

### Author: ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)
#### Post date: [October 24, 2024, 6:58am UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940/6 "2024-10-24T06:58:27Z")

</div>

@creer If I understand correctly what you’re looking for (but maybe I’m wrong), this type of behavior doesn’t require heavy artillery and can probably be created using just CSS, like in the example I show in this video.

https://pinegrow.online/@emmanuel/css-buttons/

---

<div class="post-metadata">

### Author: ![creer](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@creer](https://forum.pinegrow.com/u/creer)
#### Post date: [October 24, 2024, 8:51am UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940/7 "2024-10-24T08:51:43Z")

</div>

@Emmanuel @Riccarcharias, thank you very much, the CSS method suits me 100%. I agree that in my case, it is possible to manage with just CSS. I just wanted to make sure if it’s possible to implement my idea entirely visually using interactions - because using toggle mechanics it’s possible to realize many different animations

---

<div class="post-metadata">

### Author: ![Riccarcharias](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/riccarcharias/32/4051_2.png) [@Riccarcharias](https://forum.pinegrow.com/u/Riccarcharias)
#### Post date: [October 24, 2024, 8:54am UTC](https://forum.pinegrow.com/t/how-can-i-make-with-interactions-so-that-when-i-click-on-one-of-the-buttons-the-background-changes-to-red-and-from-the-other-radio-button-the-red-background-is-removed-toggle/9940/8 "2024-10-24T08:54:58Z")

</div>

You can’t do this with Pinegrow Interactions because there ist no trigger for “is active” or “is checked”
