The use of for..in loop on a NodeList object is not recommended, as it would loop through other properties of the NodeList. See https://developer.mozilla.org/en-US/docs/Web/API/NodeList

A simple for loop should be used instead:
for(var i=0, obj; i<inputs.length, obj=inputs[i]; i++) {