JS判断是否是数字
function isNumber(value) { var patrn = /^[0-9]*$/; if (patrn.exec(value) == null || value == "") { return false } else { return true } }
更完整点
function isNumber(value) { var patrn = /^(-)?\d+(\.\d+)?$/; if (patrn.exec(value) == null || value == "") { return false } else { return true } }
-----------------------------------------------------------------------小二给我来二两轮子!