function chk() {
var patrn = /^\d+(.\d+)?$/;
var result = true;
$(“input[type=text]”).each(function () {
if (!patrn.exec(this.value)) {
alert(“请输入正确的数字!”);
result = false;
}
})
return result;
}
转载于:https://www.cnblogs.com/WJ–NET/p/6558704.html