Created
December 8, 2018 06:02
-
-
Save goofmint/50a05f961ed33a44ef4c5685182d2150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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