Your script seems incorrect in several places.
Try this
var timetemp = document.getElementsByTagName('input');
for (var i = 0; i < timetemp.length; i++){
if (timetemp[i].value == ""){
alert ('No value');
}
else{
alert (timetemp[i].value);
}
}
Example: http://jsfiddle.net/jasongennaro/FSzT2/
Here's what I changed:
input
s via TagName
. This makes an arrayi
with a var
and then looped through the timetemp
array using the timetemp.length
property.timetemp[i]
to reference each input
in the for statement