查找最近的上级元素
// find nearest parent element
var closest = function closest(el, fn) {
return el && (fn(el) ? el : closest(el.parentNode, fn));
};
var clickedListItem = closest(eTarget, function(el) {
return el.tagName === 'A'; //事件tagname
});
if (!clickedListItem) {
return;
}