packagemainimport("github.com/gopherjs/gopherjs/js""time")funcmain(){info:=js.Global.Get("document").Call("getElementById","info")button:=js.Global.Get("document").Call("getElementById","btn")button.Set("onclick",func(e*js.Object){// time.AfterFunc is Go's setTimeouttime.AfterFunc(3*time.Second,func(){info.Set("innerHTML","time is up")})})}