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; } }