# Change Page Background When Button is Pressed

**URL:** <https://discourse.nodered.org/t/change-page-background-when-button-is-pressed/13689>\
**Category:** Dashboard\
**Created:** [25 July 2019 13:31 UTC](https://discourse.nodered.org/t/change-page-background-when-button-is-pressed/13689 "2019-07-25T13:31:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![learning](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@learning](https://discourse.nodered.org/u/learning)\
**Post date:** [25 July 2019 13:31 UTC](https://discourse.nodered.org/t/change-page-background-when-button-is-pressed/13689/1 "2019-07-25T13:31:25Z")

</div>

When I press a button on the dashboard, I would like the entire page background to change color. i.e. when I press the stop button, the background changes to a red. I am able to do it if I use javascript with the following code inside a function that is started when the button is pressed

`document.getElementsByTagName("body")[0].style.backgroundColor = "red";`

I am hoping to do this with the dashboard buttons and then maybe a function node or a template node to change the body of the page. I am not very familiar with the angular language so I am not sure how to get the msg.payload that is being sent out from the button into a template node so I can do what I need to do. I hope this makes sense and someone can help me.
