Closed Tekameikite closed 4 years ago
<div onclick="changeTheme(518)"> <span style="color:#000000;background-color:#FFFF00">foo</span> </div> ```go ui.Bind("changeTheme", func(index int) { colors := ui.Eval(fmt.Sprintf(`document.getElementsByTagName("span")>[%v].getAttribute("style");`, index)).String() fmt.Println("Colors:", colors) })
I basically got it to work like that with the index of span element but I have like 518 elements that use this function so it's not that efficient compared to using "this" keyword
I have a bind function like this:
What I need is an element like this:
and coresponding function:
I have to get "theme" element and assign it to a variable in Go
I tried doing it like this with the same html element but it's not working