# Pass Button Text as a variable to another element

**URL:** <https://forums.fusetools.com/t/pass-button-text-as-a-variable-to-another-element/6905>\
**Category:** How-to Discussions\
**Created:** [December 10, 2015, 3:38am UTC](https://forums.fusetools.com/t/pass-button-text-as-a-variable-to-another-element/6905 "2015-12-10T03:38:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Lins](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/fernando_lins/32/597_2.png) [@Fernando\_Lins](https://forums.fusetools.com/u/Fernando_Lins)\
**Post date:** [December 10, 2015, 3:38am UTC](https://forums.fusetools.com/t/pass-button-text-as-a-variable-to-another-element/6905/1 "2015-12-10T03:38:50Z")

</div>

Hi, I’m reading the Observable documentation but from what I could understand it is used to expose javascript objects to the UI. How do I do the opposite, for example passing the Text property of a button into a javascript variable? I tried using “this.Text” in the function that is called from the button, but no luck.

---

<div class="post-metadata">

**Author:** ![edA-qa\_mort-ora-y](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/eda-qa_mort-ora-y/32/124_2.png) [@edA-qa\_mort-ora-y](https://forums.fusetools.com/u/edA-qa_mort-ora-y)\
**Post date:** [December 10, 2015, 6:24am UTC](https://forums.fusetools.com/t/pass-button-text-as-a-variable-to-another-element/6905/2 "2015-12-10T06:24:32Z")

</div>

Observables are two-way bindings so you can read the value back from it.

```auto
<App Theme="Basic" ux:Class="MyApp" ClearColor="1,1,1,1">
    <ClientPanel>
        <JavaScript>
            var Observable = require("FuseJS/Observable")

            var myText = Observable()
            myText.value = "hello"

            module.exports = {
                myText: myText,
                go: function(s,a) {
                    console.log( "> " + myText.value )
                }
            }
        </JavaScript>
        <StackPanel>
            <TextInput Value="{myText}"/>
            <Button Text="Go" Clicked="{go}"/>
        </StackPanel>
    </ClientPanel>
</App>

```

---

<div class="post-metadata">

**Author:** ![Fernando\_Lins](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/fernando_lins/32/597_2.png) [@Fernando\_Lins](https://forums.fusetools.com/u/Fernando_Lins)\
**Post date:** [December 10, 2015, 4:01pm UTC](https://forums.fusetools.com/t/pass-button-text-as-a-variable-to-another-element/6905/3 "2015-12-10T16:01:05Z")

</div>

Ah, excellent! Thank you very much!

---

<div class="post-metadata">

**Author:** ![Marcelo\_Amorim](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/marcelo_amorim/32/592_2.png) [@Marcelo\_Amorim](https://forums.fusetools.com/u/Marcelo_Amorim)\
**Post date:** [May 10, 2017, 7:33pm UTC](https://forums.fusetools.com/t/pass-button-text-as-a-variable-to-another-element/6905/4 "2017-05-10T19:33:18Z")

</div>

The solution to my APP problem…
