Try regex then:
function checkInp() {
var input = document.getElementsByTagName("input");
for (var i =0; i < input.length; i++) {
if (input[i].type == "text") {
var str = input[i].value;
var pattern = /^[-]?(\d+(?:[\.\,]\d+)?)$/g;
var result = pattern.test(str);
if (!result) {
alert("Not Number");
return false;
} else {
alert(input[i].value);
}
}
}
}
Read more:
JavaScript RegExp Reference[
^]