Can not pass parameters to js.Func

I’ve the below code where the function attached properly to the button onclick event:

func f(this js.Value, args []js.Value) interface{} {
	println("hello world")
	return nil
btn.Set("onclick", js.FuncOf(f))

I tried to pass args for this function as:

btn.Set("onclick", js.FuncOf(f).Invoke("Hello World"))

And manipulate it in the js.Func as:

	for x := range args {

But I got the error:

wasm_exec.js:421 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'exports')
    at syscall/js.valueInvoke (wasm_exec.js:421)
    at syscall_js.valueInvoke (main.wasm:0x133521)
    at syscall_js.Value.Invoke (main.wasm:0x131300)
    at main.html (main.wasm:0x25b572)
    at main.main (main.wasm:0x25e591)
    at runtime.main (main.wasm:0x7f285)
    at wasm_pc_f_loop (main.wasm:0xddf81)
    at wasm_export_run (main.wasm:0xddf54)
    at (wasm_exec.js:577)
    at init (wasm.js:7)

Any thought?

I solved it using .bind as below:

element.Set("onclick", js.FuncOf(f).Call("bind", e, args...)) 
// bind(event, arguments...), passed to function f as (arguments..., event)

So, my code become:

btn.Set("onclick", js.FuncOf(f).Call("bind", btn, "hi", "hello"))

func f(this js.Value, args []js.Value) interface{} {
	for index, item := range args {
		if x < len(args)-1 { // len(args)-1 is the event itself
			println(index, item.String())

	self := args[len(args)-1].Get("target")
	// self = == this
	self.Get("style").Call("setProperty", "background-color", "red")
    // same as:
	// this.Get("style").Call("setProperty", "background-color", "red")
	return nil