var num = 0; //判断是否数字 var reg = /^\-?([1-9]\d*|0)(\.\d+)?$/; if(!reg.test(order)) { alert('必须输入数字型'); } 相关文章: