1
0
mirror of https://github.com/taigrr/wasm-experiments synced 2025-01-18 04:03:21 -08:00

Add jsgo.io example

This commit is contained in:
Johan Brandhorst
2018-08-15 17:00:38 +01:00
parent 50d7c00276
commit 31e31e865c
823 changed files with 404944 additions and 1 deletions

20
jsgo/main.go Normal file
View File

@@ -0,0 +1,20 @@
// +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)
}