<script>
function chk(str){
return !isNaN(Date.parse(str.replace("-","/")))
}
alert(chk("2002-7-26"))
alert(chk("1231231321"))
</script><script>
function chk2(str){
return Date.parse(str.replace("-","/"))>0
}
alert(chk2("2002-7-26"))
alert(chk2("1231231321"))
</script>还有利用正则验证
function chk(str){
return !isNaN(Date.parse(str.replace("-","/")))
}
alert(chk("2002-7-26"))
alert(chk("1231231321"))
</script><script>
function chk2(str){
return Date.parse(str.replace("-","/"))>0
}
alert(chk2("2002-7-26"))
alert(chk2("1231231321"))
</script>还有利用正则验证
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货