Web API package for use when compling Go to WASM
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

22 lines
446 B

package main
import (
"fmt"
"syscall/js"
dom "github.com/brettlangdon/go-dom/v1"
)
func onLoad(evt js.Value) {
fmt.Println("LOADED")
fmt.Printf("%#v\r\n", evt)
}
func main() {
dom.Document.AddEventListener("DOMContentLoaded", js.NewEventCallback(0, onLoad))
fmt.Printf("%#v\r\n", dom.Document)
body := dom.Document.GetBody()
for i := 0; i < 50; i += 1 {
body.AppendChild(dom.Document.CreateElement(fmt.Sprintf("TEST-%d", i)))
}
}