I am trying to apply an onclick function to an array of three elements, but setting the onclick property of the array does not work. Any ideas would be really helpful.
Thanks!
Here is my code:
var btnArray = [
document.getElementById('buttonOne'),
document.getElementById('buttonTwo'),
document.getElementById('buttonThree'),
];
console.log(btnArray);
btnArray.onclick = function revilImg() {
console.log('hey');
}