Elijah• 320
@taco-neko
Posted
Can you elaborate what you mean by having problems with the DOM?
I've noticed you haven't written an onclick event for the buttons, and also, you're not adding the event listener correctly. You've written
let boton = document.getElementsByClassName("botonC")
boton = document.addEventListener('click', function() {
})
but you should write
const boton = document.getElementsByClassName("botonC")
boton.forEach( (item) => {
item.addEventListener( 'click', (event) => {
// your function here
})
})
0