If you try out your code in Javascript you can spot your error, it would be 
something like:

but.className = "somecssclass";
but.addEventListener("click", somefunction);


so for syscall/js (untested) something like:

var cb js.Callback cb = js.NewCallback(func(args []js.Value) { 
fmt.Println("Clicked") }) but.Set("className", "button42") 
but.Call("addEventListener", "click", cb)





On Saturday, 30 March 2019 12:01:45 UTC, whiteh...@googlemail.com wrote:
>
> So I create a html button, and try to set some attributes, some work, some 
> fail, is there a reason for this?
>
>
>     but := doc.Call("createElement", "button")
>     but.Set("id", bID) //works
>     but.Set("innerHTML", "Don't Panic") //works
>     but.Set("title", "mybuton") //works
>     but.Set("class", "button42") //does not work
>     but.Set("onClick", "pressed();") //does not work
>
> Thanks, Peter
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to