Skip to content

Instantly share code, notes, and snippets.

@Seth-Carter
Created March 12, 2020 12:21
Show Gist options
  • Save Seth-Carter/ad4976ed7e9aaad2cf2c941d80883978 to your computer and use it in GitHub Desktop.
Save Seth-Carter/ad4976ed7e9aaad2cf2c941d80883978 to your computer and use it in GitHub Desktop.
function handleBuyButtonClick(event) {
console.log('You clicked a button!');
const button = event.target;
// console.log(button.textContent);
// console.log(parseFloat(event.target.dataset.price));
console.log(event.target);
console.log(event.currentTarget);
console.log(event.target === event.currentTarget);
// Stop this event from bubbling up
// event.stopPropagation();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment