# Help with Variables For Student

**URL:** https://forum.code.org/t/help-with-variables-for-student/37500
**Category:** Unit and Lesson Discussion
**Created:** [January 19, 2023, 1:22pm UTC](https://forum.code.org/t/help-with-variables-for-student/37500 "2023-01-19T13:22:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jcostanza](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jcostanza](https://forum.code.org/u/jcostanza)
#### Post date: [January 19, 2023, 1:22pm UTC](https://forum.code.org/t/help-with-variables-for-student/37500/1 "2023-01-19T13:22:44Z")

</div>

Trying to help my student. Might be an issue with variables. He wants the block to turn the color specified in the drop down menu when clicked. [App Lab - Code.org](https://studio.code.org/projects/applab/zmS8FBKh0hc3LQpwXTUZRJIOwBRB5ezwnFtFAbK9wJA)

---

<div class="post-metadata">

### Author: ![letti42](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@letti42](https://forum.code.org/u/letti42)
#### Post date: [January 20, 2023, 2:37am UTC](https://forum.code.org/t/help-with-variables-for-student/37500/2 "2023-01-20T02:37:23Z")

</div>

When you say `var x = "<color>"` in one of the event functions, it creates a new variable that is defined only in that event scope (meaning, you can only use that variable in that function). If you get rid of the `var` keyword before it, then you will be able to access the global x variable and it should work.
