Skip to content

Instantly share code, notes, and snippets.

@ivancorrales
Created April 28, 2022 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivancorrales/66bb7727bf55643351565cf3a7772e0f to your computer and use it in GitHub Desktop.
Save ivancorrales/66bb7727bf55643351565cf3a7772e0f to your computer and use it in GitHub Desktop.
package main
import (
"syscall/js"
)
func main() {
document := js.Global().Get("document")
h2 := document.Call("createElement", "h2")
h2.Set("innerHTML", "Sample 3 | Appending HTML elements")
div := document.Call("getElementById", "main")
div.Call("appendChild", h2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment