Answer the question
In order to leave comments, you need to log in
Why is [object HTMLButtonElement] displayed instead of text?
Here is the code:
let a = document.querySelector('.a'),
b = document.querySelector('.b'),
c = document.querySelector('.c');
const input = document.querySelector('.input')
let array = [a,b,c]
let pup = []
for (let element of array) {
element.addEventListener('click', ()=>{
pup.push(element)
console.log(pup.join(''))
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question