<html>
<head>
<title>FocusTest</title>
<script>
function Test(){
var objValue =document.getElementById('txt1').value;
if(isNaN(objValue)==false && objValue>0 ){
alert("yes");
}
else{
alert("no");
}
}
</script>
</head><body>
<form>
<input type="text" name="txt1" id="txt1" onblur="Test()" value="输入数字焦点移开">
</form>
</body>
</html>
<head>
<title>FocusTest</title>
<script>
function Test(){
var objValue =document.getElementById('txt1').value;
if(isNaN(objValue)==false && objValue>0 ){
alert("yes");
}
else{
alert("no");
}
}
</script>
</head><body>
<form>
<input type="text" name="txt1" id="txt1" onblur="Test()" value="输入数字焦点移开">
</form>
</body>
</html>
if(num.replace(".","").replace(/0/g,"")==""){alert("false");return;}
var reg2 = /^[^-]\d*(\.\d+)?/i;
if(reg2.test(num))
{
alert("true");
return;
}
alert("false");
本来是给 s_liangchao1s 20.给你5的..但是 BT 的CSDN说..我给的分不合理..直接从我的总分里扣5分就好了.
它却说 不合理..真BT..==============
做软件的:最重要的是 易用..方便..简单