Image for post
Image for post
Photo by Immo Wegmann on Unsplash
const dartBoard = document.getElementById('dart-board')
darBoard.addEventListener('hit', eventHandler)
function eventHandler(e){
if (e.target.className === 'bullseye'){
console.log('Ten points for Gryffindor!')
}
function eventHandler(e){if( e.target.className === 'bullseye'){
award50Points()
} else if (e.target.className === 'bull'){
award25Points()
} else if (e.target.className === 'triple-ring'){
scoreTimes3()
} else if (e.target.className === 'double-ring'){
scoreTimes2()
}
likeBtn.addEventListener('click', eventHandler, {once: true})

Written by

An aspiring coder, trying to make sense of The World (of coding.)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store