I want to add eventListener Click to each element of a NodeList. I've tried the following
var test = document.getElementsByClassName('productLnk')
function theTest (element,index,array){
element.addEventListener('click',function(){
console.log('hello')
})
}
test.forEach(theTest)
It returns test.forEach is not a function