I have simple program here. It works, but still appear error in browser input_Login is undefined, why? I don't understand it, please help.
var input_Login = document.getElementsByTagName('input')[0];
function inputCheck(){
this.style.color='pink';
}
input_Login.addEventListener('input', inputCheck);