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

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-11-21
  • 2021-12-19
  • 2022-12-23
猜你喜欢
  • 2021-10-27
  • 2021-11-21
  • 2022-12-23
  • 2021-10-16
  • 2021-11-21
  • 2021-11-21
  • 2022-12-23
相关资源
相似解决方案