所以我有这个程序,只要expiration date
与today
的日期完全相同,<div>
的背景就会改变它的颜色。但是现在,背景颜色仅在我的条件为==
时才会发生变化,当我尝试使用>=
或<=
时背景颜色不会改变。即使expiration date
的背景颜色变化也与date today
这是我的javascript:
<script type="text/javascript">
var $today = date("m/d/Y");
var $expired = $passport_expiration;
function myDIV() {
if ($today == $expired) {
document.getElementById("myDiv").style.backgroundColor="#ff4d4d";
}
}
</script>
这是我的HTML:
<div class="col-md-6" id="myDiv">
<div class="alert" role="alert"><span class="glyphicon glyphicon-book" aria-hidden="true"></span> Passport <?php echo "<strong><a href=\"view_latest_passport.php?id=$id\"> $passport</a> / Passport Expiration Date:</strong> $passport_expiration"; ?></div>
</div>
我如何获得$today
和passport_expiration
,它位于query
提前谢谢
答案 0 :(得分:0)
unset GIT_DIR
cd ..
git merge master
你需要在输入字段中分配那些值,然后才能在javascript中验证
<div class="col-md-6" id="myDiv">
<div class="alert" role="alert">
<span class="glyphicon glyphicon-book" aria-hidden="true"></span>
Passport <?php echo "<strong><a href=\"view_latest_passport.php?id=$id\"> $passport</a> /
Passport Expiration Date:</strong> $passport_expiration"; ?></div>
<input type="hidden" id="passport_expire_date" name="passport_expire_date" value="<?php echo $passport_expiration; ?>">
<?php $date = date("m/d/Y "); ?>
<input type="hidden" id="today_date" name="today_date" value="<?php echo $date; ?>">
</div>