Skip to content

Instantly share code, notes, and snippets.

@ivancorrales
Last active April 28, 2022 17:07
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/dafcf99bcb2cf8ab6d2a71dd5620f93c to your computer and use it in GitHub Desktop.
Save ivancorrales/dafcf99bcb2cf8ab6d2a71dd5620f93c to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"syscall/js"
"time"
)
func main() {
currentTime := time.Now().Format("2006-01-02 15:04:05")
h2Element := js.Global().Get("document").
Call("getElementById", "description")
msg := fmt.Sprintf(
"Sample 2 | Modifying the HTML (%s)",
currentTime)
h2Element.Set("innerHTML", msg)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment