`
document.getElementById('list').addEventListener('click', function (e) {
var event = e || window.event;
var target = event.target || event.srcElement;
if (target.nodeName.toLocaleLowerCase === 'li') {
console.log('the content is: ', target.innerHTML);
}
});`
element.addEventListener(event, function, useCapture) 【false是冒泡】
target:真正被点到的node eventTarget:代理的node
` document.getElementById('list').addEventListener('click', function (e) { var event = e || window.event; var target = event.target || event.srcElement;
if (target.nodeName.toLocaleLowerCase === 'li') { console.log('the content is: ', target.innerHTML); } });`