var type = "dy"; var obj = { "ym": popupYM, "date": popupDate, ... }; console.log(obj[type]); _self.elem.addEventListener('click', obj[type]);