const elf = document.getElementById("elf")
const btn = document.getElementById("btn")
let elfCount = 1
btn.addEventListener("click", duplicateElf)
function duplicateElf(){
/** Challenge:
- Write a function to duplicate the elf when the button is clicked.
- See index.css for optional styling challenges.
**/
console.log(`Elf count: ${elfCount}`)
if (elfCount < 100) {
elf.textContent += '🧝'
elfCount += 1
} else if (elfCount == 100) {
console.log('Oops, it is a full house!')
}
}
/** Stretch goals:
- Write a function to give the elves some tools, or a cup of tea!
- Limit the total number of elves to 100.
**/