请教个问题,下面的函数是判断输入的数字范围的,我现在想再加一个条件任何修改?输入在数字不能小于130厘米或大于210厘米!但是可以输入0,这个条件怎么加?function Check1(txt)
{
if(isNaN(txt.value)){
alert("输入数据为数字!");
txt.style.backgroundColor="#FF9933";
txt.focus();
txt.select();
return false;
}
else if(parseFloat(txt.value)>210||parseFloat(txt.value)<130){
alert("不能小于130厘米或大于210厘米!");
txt.style.backgroundColor="#FF9933";
txt.focus();txt.select();
return false;}
else
{
txt.style.backgroundColor="#FFFFFF";
return true;
}
}
{
if(isNaN(txt.value)){
alert("输入数据为数字!");
txt.style.backgroundColor="#FF9933";
txt.focus();
txt.select();
return false;
}
else if(parseFloat(txt.value)>210||parseFloat(txt.value)<130){
alert("不能小于130厘米或大于210厘米!");
txt.style.backgroundColor="#FF9933";
txt.focus();txt.select();
return false;}
else
{
txt.style.backgroundColor="#FFFFFF";
return true;
}
}
var v= parseFloat(txt.value);
if(v!=0 && v>130 && v<210 )