<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
var date = new Date();
var strDate = date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()+"日";
function onLoad(){
document.getElementById("inDate").style.color="#ff0000";
document.getElementById("inDate").innerText = strDate;
}
function onFoucs(o){
document.getElementById("inDate").style.color="#00ff00";
if(o.value == strDate){
o.value = "";
}
}
function onBlur(o){
document.getElementById("inDate").style.color="#0000ff";
if(o.value == ""){
o.value = strDate;
}
}
</script>
</head>
<body onLoad="onLoad()">
<input type="text" id="inDate" onFocus="onFoucs(this)" onBlur="onBlur(this)">
</body>
</html>