Adding eventlistener to each of them is not advisable. May be this can help:
document.getElementById('parent').addEventListener('click', function(e){
alert(e.target.value);
})
And if you only want to do using getElementsByTagName or getElementsByClassName, then i guess you need to iterate for the array returned.