let arr = [...document.getElementsByClassName("test_class")]
for (let i=0; i < arr.length; i++) {
arr[i].onclick = function(){
alert("Click!");
}
};
arr.forEach(function(entry) {
entry.onclick = function(){
alert("Click!");
}
});
arr.map(function(entry) {
entry.onclick = function(){
alert("Click!");
}
return entry;
}