<!--把下列代码放到HEAD区域内-->
<head>
<style type="text/css">
<!--
.headline {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #0000B0;
}
.headline-new {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #FF0000;
background-color: #e8f4ff;
display: inline;
}
-->
</style>
<script type="text/javascript">
//more javascript from http://www.webjx.com
<!-- Begin
function checknew(date) {
var expdate = new Date(date);
var curdate = new Date();
if (expdate.getTime() > curdate.getTime())
{
document.write('<div class="headline-new">');
}
else
{
document.write('<div class="headline">');
}
}
// End -->
</script>
</head>
<!--把下列代码放到body区域内-->
<body>
<script type="text/javascript">checknew("06/08/2009")</script>
这是一个新内容</div>
<br><br>
<script type="text/javascript">checknew("04/30/2005")</script>
这是一个过期内容</div>
</body>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]