jQuery.validator.addMethod("integer", function (value, element) { var tel = /^-?\d+$/g; //正、负 整数 + 0 return this.optional(element) || (tel.test(value)); }, "请输入整数");