I know that getElementsByTagName and getElementsByClassName need an index identifier in order for the objects to be bound to an event listener.
It's pretty simple like @Rutwick Gangurde said. Once you get the elements you just need to loop through and attach the event.
var inputElem = document.getElementsByTagName('input');
for(var i = 0; i < inputElem.length; i++) {
inputElem[i].addEventListener('click', function(){
alert(this.value);
}, false);
}
Here it is in a fiddle: http://jsfiddle.net/wm7p0a77/