# How to change background color on button click?

**URL:** <https://community.weweb.io/t/how-to-change-background-color-on-button-click/1955>\
**Category:** Ask us anything\
**Tags:** binding, design\
**Created:** [March 2, 2023, 6:06pm UTC](https://community.weweb.io/t/how-to-change-background-color-on-button-click/1955 "2023-03-02T18:06:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uddeshya](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/uddeshya/32/2296_2.png) [@Uddeshya](https://community.weweb.io/u/Uddeshya)\
**Post date:** [March 2, 2023, 6:06pm UTC](https://community.weweb.io/t/how-to-change-background-color-on-button-click/1955/1 "2023-03-02T18:06:57Z")

</div>

How to change background color on button click? Sought of Dark Mode

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [March 2, 2023, 6:16pm UTC](https://community.weweb.io/t/how-to-change-background-color-on-button-click/1955/2 "2023-03-02T18:16:00Z")

</div>

You could bind the background color of all the sections on your page to a `backgroundColor` variable that has a default value of #FFFFFF for example and, trigger a workflow `On click` that changes the variable value to #000000.

Does that make sense or would a video help?

---

<div class="post-metadata">

**Author:** ![Uddeshya](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/uddeshya/32/2296_2.png) [@Uddeshya](https://community.weweb.io/u/Uddeshya)\
**Post date:** [March 2, 2023, 6:18pm UTC](https://community.weweb.io/t/how-to-change-background-color-on-button-click/1955/3 "2023-03-02T18:18:04Z")

</div>

I got your approach, but a video can help a lot 🙂

---

<div class="post-metadata">

**Author:** ![Uddeshya](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/uddeshya/32/2296_2.png) [@Uddeshya](https://community.weweb.io/u/Uddeshya)\
**Post date:** [March 2, 2023, 6:58pm UTC](https://community.weweb.io/t/how-to-change-background-color-on-button-click/1955/4 "2023-03-02T18:58:40Z")

</div>

Also how can I bind all sections to a background color variable, I tried adding background color to object but it doesn’t work

---

<div class="post-metadata">

**Author:** ![mauromequelussi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/mauromequelussi/32/10223_2.png) [@mauromequelussi](https://community.weweb.io/u/mauromequelussi)\
**Post date:** [April 22, 2023, 4:46pm UTC](https://community.weweb.io/t/how-to-change-background-color-on-button-click/1955/5 "2023-04-22T16:46:34Z")

</div>

any news about this?

---

<div class="post-metadata">

**Author:** ![GeovanyFerreira](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/geovanyferreira/32/13093_2.png) [@GeovanyFerreira](https://community.weweb.io/u/GeovanyFerreira)\
**Post date:** [April 24, 2023, 9:29am UTC](https://community.weweb.io/t/how-to-change-background-color-on-button-click/1955/6 "2023-04-24T09:29:01Z")

</div>

@Joyce any news about this?
