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 ( === 'bullseye'){
console.log('Ten points for Gryffindor!')
function eventHandler(e){if( === 'bullseye'){
} else if ( === 'bull'){
} else if ( === 'triple-ring'){
} else if ( === 'double-ring'){
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