您的位置:首页 > Web前端 > JQuery

jquery判空 string类型的日期比较大小

2013-12-12 13:57 232 查看
jquery 判空

if(value.length<=0){
alert("kongzhi");
}

jquery string类型的日期比较大小

var startTime = document.getElementById("startTime").value;

var endTime = document.getElementById("endTime").value;

if (startTime.length > 0 && endTime.length > 0) {
var start=new Date(startTime.replace("-", "/").replace("-", "/"));
var end=new Date(endTime.replace("-", "/").replace("-", "/"));
if (start > end) {
alert("起始时间大于结束时间,请重新选择!");
return;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: