function duplicateElf(){ // Task: // - Write a function to duplicate the elf when the button is clicked. // - See index.css for optional styling challenges. elf.innerText += '🧝' }
// Stretch goals: // - Write a function to give the elves some tools, or a cup of tea! // - Limit the total number of elves to 100.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const elf = document.getElementById("elf")
const btn = document.getElementById("btn")
btn.addEventListener("click", duplicateElf)
function duplicateElf(){
// Task:
// - Write a function to duplicate the elf when the button is clicked.
// - See index.css for optional styling challenges.
elf.innerText +='🧝'
}
// Stretch goals:
// - Write a function to give the elves some tools, or a cup of tea!