Updated example.
This commit is contained in:
parent
490c5e5cc5
commit
cc5c1a3e20
@ -41,9 +41,11 @@ func constructBody() {
|
|||||||
|
|
||||||
startTestButton := elements.NewButton(&elements.ButtonOptions{
|
startTestButton := elements.NewButton(&elements.ButtonOptions{
|
||||||
Class: "button is-large is-rounded is-primary",
|
Class: "button is-large is-rounded is-primary",
|
||||||
|
ID: "main_button",
|
||||||
Text: "Click Me!",
|
Text: "Click Me!",
|
||||||
OnClickHandler: func(e *js.Object) {
|
OnClickHandler: func(e *js.Object) {
|
||||||
common.Log("Button clicked! Hooray")
|
common.Log("Button clicked! Hooray")
|
||||||
|
js.Global.Get(common.HTMLElementDocument).Call("getElementById", "main_button").Set("textContent", "Clicked!")
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
centerDiv.AddChild(startTestButton)
|
centerDiv.AddChild(startTestButton)
|
||||||
|
Loading…
Reference in New Issue
Block a user