I will be grateful for the help in how to implement $ (el) .trigger ('my-event', {some: 'data'}); in native js (without using jquery).
I was able to implement a binder without jquery.
if (window.addEventListener) {
window.addEventListener(event, func, false);
}
else if (window.attachEvent) {
window.attachEvent(event, func);
}
I forgot to mention it needs to be supported in IE8 to be more specific. I need a custom trigger 'my-event', not my own trigger, like 'click'
Wagdi source
share