1
0
mirror of https://github.com/taigrr/wasm-experiments synced 2026-03-26 07:22:33 -07:00
Files
wasm-experiments/jsgo/main.go
Johan Brandhorst 31e31e865c Add jsgo.io example
2018-08-15 17:23:29 +01:00

21 lines
300 B
Go

// +build js,wasm
package main
import "syscall/js"
var document js.Value
func init() {
document = js.Global().Get("document")
}
func main() {
div := document.Get("body")
node := document.Call("createElement", "div")
node.Set("innerHTML", "Hello jsgo.io!")
div.Call("appendChild", node)
}