<script language="Jscript">
function check()
{
//Reg = /^(^-?\d+$)$/ //输入的必须是整数(正负整数)
Reg = /^(^\d+$)$/ //输入的必须是正整数
alert(Reg.test(document.all.txt1.value))
}
</script>
<input type="text" name="txt1" >
<input type="button" onclick="check()" value="Check">