Add multiple native, custom, or X-Tag library event listeners to an element using one function.

xtag.addEvents(ELEMENT, OBJECT)

ArgumentsTypeDescription
ELEMENTDOM element referenceThe element you would like to attach event listeners to.
OBJECTObjectAn object composed of multiple events - keys are event names, and values are the event handlers.
xtag.addEvents(myElement, {
  'tap': function(event){
		alert('myElement was just tapped ' + this);
  },
  'keypress': function(event){
  	alert('the following key was pressed on myElement' + e.keyCode);
  }
});