摘要: js: 大于0的正整数 var txtValue=document.getElementById("a").value; if(txtValue.match(/^[0-9]*[1-9][0-9]*$/)) alert("请输入正整数");"^\\d+$ " //非负整数(正整数 + 0) "^[0-9]*[1-9][0-9]*$ " //正整数 "^((-\\d+)|(0+))$ " //非正整数(负整数 + 0) "^-[0-9]*[1-9][0-9]*$ " //负整数 阅读全文
posted @ 2011-11-18 11:35 cherry0917 阅读(3686) 评论(0) 推荐(1) 编辑