Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import "syscall/js"
func main() {
document := js.Global().Get("document")
button := document.Call("getElementById", "btn")
cb1 := js.NewCallback(func(args []js.Value) {
println("Clicked");
})
button.Call("addEventListener", "click", cb1)
<-make(chan struct{}, 0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment