dominikh / go-js-dom

MIT License
252 stars 42 forks source link

DispatchEvent of "Click"/"Change" #61

Closed inkeliz closed 6 years ago

inkeliz commented 6 years ago

Using this library is possible to listen the Click or Change, like el.AddEventListener("change", false, func(...)).

However, how can I use the DispatchEvent? I mean, how I can el.DispatchEvent("change") to trigger the listener?

inkeliz commented 6 years ago

I found a solution:

element.DispatchEvent(dom.WrapEvent(js.Global.Get("Event").New("change")))