Add a native, custom, or X-Tag library event listener to an element.
xtag.addEvent(ELEMENT, TYPE, FUNCTION)
xtag.addEvent(ELEMENT, TYPE, FUNCTION)
Arguments | Type | Description |
---|---|---|
ELEMENT | DOM element reference | The element you would like to attach an event listener to. |
TYPE | String | The event name, with any event pseudos you may want to chain. |
FUNCTION | Function | The event handler you wish to use when the event occurs. |
xtag.addEvent(myElement, 'tap', function(event){
alert('myElement was just tapped ' + this);
});