var date = new Date();
var seperator1 = "-";
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate;
var date = document.getElementById("date").value;
if(currentdate == date){
$("#btn_id").show();
$("#btn_id").show();
$("#btn_id").show();
}else{
$("#btn_id").hide();
$("#btn_id").hide();
$("#btn_id").hide();
}
JS通过对比当前日期和JSP传回的日期来判断显示/隐藏按钮
最新推荐文章于 2024-05-28 18:16:16 发布