# Dynamic web pages with Interact and Mux

**URL:** <https://discourse.julialang.org/t/dynamic-web-pages-with-interact-and-mux/31360>\
**Category:** Web Stack\
**Tags:** question\
**Created:** [November 21, 2019, 9:15pm UTC](https://discourse.julialang.org/t/dynamic-web-pages-with-interact-and-mux/31360 "2019-11-21T21:15:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KajWiik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kajwiik/32/199_2.png) [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Post date:** [November 21, 2019, 9:15pm UTC](https://discourse.julialang.org/t/dynamic-web-pages-with-interact-and-mux/31360/1 "2019-11-21T21:15:34Z")

</div>

I am trying to write a web GUI controlling some instruments. The basic widgets are working but I’d need to print some variables in real time. MWE follows:

```julia
using Mux, Interact, CSSUtil
s = slider(0:0.01:1, label="Slider")
display(s)
observe(s)
h = HTML(string("<div>Slider value:",s[],"</div>"))
ui = vbox(s, h)
WebIO.webio_serve(page("/", req -> ui), 8110)

```

The goal is that the ‘Slider value’ field changes with variable s. With the code above, it only prints the initial value and stays constant.

---

<div class="post-metadata">

**Author:** ![KajWiik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kajwiik/32/199_2.png) [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Post date:** [November 22, 2019, 9:12pm UTC](https://discourse.julialang.org/t/dynamic-web-pages-with-interact-and-mux/31360/2 "2019-11-22T21:12:05Z")

</div>

Found it out myself, the following works:

```julia
using Mux, Interact, CSSUtil
s = slider(0:0.01:1, label="Slider")
observe(s)
display(s)
h = map(x -> HTML(string("<div>Slider value:",x,"</div>")), observe(s))
ui = vbox(s, h)
WebIO.webio_serve(page("/", ui), 8110)

```
