code: function on(name, fn, elem) {
    var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  
    return (elem || doc).addEventListener(name, fn, useCapture);
  }
docs: Add dom event