diff options
author | 2014-05-02 15:32:10 -0400 | |
---|---|---|
committer | 2014-05-02 15:32:10 -0400 | |
commit | 1580340ec252e4e399c2c1d2b403974f49c3a084 (patch) | |
tree | e35283c198e93ed20c6a38a6d01361630a6b0771 /tests/data_attr.ur | |
parent | 48f4fa7d2482829d6195e91e1cd4c5a940aacab4 (diff) |
HTML5 data-* attributes
Diffstat (limited to 'tests/data_attr.ur')
-rw-r--r-- | tests/data_attr.ur | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/data_attr.ur b/tests/data_attr.ur new file mode 100644 index 00000000..80dda857 --- /dev/null +++ b/tests/data_attr.ur @@ -0,0 +1,26 @@ +fun dynd r = return <xml><body> + <div data={data_attr r.Attr r.Value}>How about that?</div> +</body></xml> + +fun main () : transaction page = + s <- source <xml/>; + a <- source ""; + v <- source ""; + return <xml><body> + <div data-foo="hi" data-bar="bye" data-baz="why">Whoa there, cowboy!</div> + + <hr/> + + <form> + <textbox{#Attr}/> = <textbox{#Value}/> + <submit action={dynd}/> + </form> + + <hr/> + + <ctextbox source={a}/> = <ctextbox source={v}/> + <button onclick={fn _ => + a <- get a; v <- get v; set s <xml><div data={data_attr a v}>OHO!</div></xml>}/> + <hr/> + <dyn signal={signal s}/> + </body></xml> |