# Button for select/unselect

**URL:** https://community.thunkable.com/t/button-for-select-unselect/1504277
**Category:** Questions about Thunkable X
**Created:** [September 14, 2021, 8:04am UTC](https://community.thunkable.com/t/button-for-select-unselect/1504277 "2021-09-14T08:04:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Pablo](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Pablo](https://community.thunkable.com/u/Pablo)
#### Post date: [September 14, 2021, 8:04am UTC](https://community.thunkable.com/t/button-for-select-unselect/1504277/1 "2021-09-14T08:04:51Z")

</div>

Hello everyone.  
I am making some buttons to select/unselect options.  
I am using this block to change the background of the button depending if it is selected or not and to set the variable:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/e/ceec486fede62d8c7bf49ee148c4d836384e8dff.png)

Works fine (except that I have to double click at the beginning to get it to start working)  
I would like to know if there is a simpler way to do what I am doing (select/unselect) as I have a lot of buttons to add.  
Thanks

---

<div class="post-metadata">

### Author: ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)
#### Post date: [September 14, 2021, 9:22am UTC](https://community.thunkable.com/t/button-for-select-unselect/1504277/2 "2021-09-14T09:22:20Z")

</div>

Hi there,

These are the correct blocks to use.

If you have many Buttons in your project, you can make things easier by using [Any Component blocks](https://docs.thunkable.com/v/drag-and-drop/any-component-blocks) to make generic blocks that fire when any Button is pressed.

You can use blocks like this to update the Button colors/their corresponding variables when Buttons are pressed:

 ![Screen Shot 2021-09-14 at 10.20.06 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/7/47067ae5111d5bc0789407dece161905ca74532d.png)

In this example, I also add the selected items to a list and display them in a List Viewer:

 ![Screen Shot 2021-09-14 at 10.22.00 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/5/b5484ece32383f45761b9762a9c01d63be995b50.png)

You can see a demo of this [here.](https://x.thunkable.com/projectPage/6140673ee145110011ec83df)  
.

---

<div class="post-metadata">

### Author: ![Pablo](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Pablo](https://community.thunkable.com/u/Pablo)
#### Post date: [September 14, 2021, 9:36am UTC](https://community.thunkable.com/t/button-for-select-unselect/1504277/3 "2021-09-14T09:36:50Z")

</div>

Thanks!

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:16pm UTC](https://community.thunkable.com/t/button-for-select-unselect/1504277/4 "2024-11-08T13:16:52Z")

</div>


