const container = document.querySelector('#container');
const output = document.querySelector('#content');
const btn = document.querySelector('button');
function handleClick(e){
// e.stopPropagation();
output.textContent += `You clicked on the ${e.currentTarget.tagName} element!\n`;
// e.stopPropagation();
}
document.body.addEventListener('click', handleClick);
container.addEventListener('click', handleClick);
btn.addEventListener('click', handleClick);
const container = document.querySelector('#container');
const output = document.querySelector('#content');
const btn = document.querySelector('button');
function handleClick(e){
// e.stopPropagation();
output.textContent += `You clicked on the ${e.currentTarget.tagName} element!\n`;
// e.stopPropagation();
}
document.body.addEventListener('click', handleClick);
container.addEventListener('click', handleClick);
btn.addEventListener('click', handleClick);