<style>
input{
display: block;
}
</style>
<body>
<ul><input type="text"><input type="text"><input type="text"><input type="text"></ul>
</body>
var inpArr = document.getElementsByTagName('input')
for(var i = 0;i < inpArr.length;i++){
inpArr[i].onfocus = function(){
this.style.border = '2px solid #008c8c'
this.style.backgroundColor = '#ccc'
}
inpArr[i].onblur = function(){
this.style.border = ''
this.style.backgroundColor = ''
}
}