<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""><script>function dateShow(){ var index = document.getElementById("888").options.selectedIndex; var indexValue = document.getElementById("888").options[index].text;
if(indexValue != "" && indexValue != null){ alert(indexValue) var today = new Date();
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT=""><script>function dateShow(){
var index = document.getElementById("888").options.selectedIndex;
var indexValue = document.getElementById("888").options[index].text;
if(indexValue != "" || indexValue != null){
var today = new Date();
today.setDate(today.getDate()-3)
alert(today)
}
}
</script>
</HEAD><BODY>
<select onChange="dateShow()" id="888">
<option></option>
<option >3</option>
<option>5</option>
</select>
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT=""><script>function dateShow(){
var index = document.getElementById("888").options.selectedIndex;
var indexValue = document.getElementById("888").options[index].text;
if(indexValue != "" || indexValue != null){
var today = new Date();
today.setDate(today.getDate()-indexValue)
if(index == 1){
document.getElementById("t1").style.display="";
document.getElementById("t2").style.display="none";
document.getElementById("t1").value= today;
}else{
document.getElementById("t1").style.display="none";
document.getElementById("t2").style.display="";
document.getElementById("t2").value= today;
}
}
}
</script>
</HEAD><BODY>
<select onChange="dateShow()" id="888">
<option></option>
<option >3</option>
<option>5</option>
</select><input type="text" id="t1" value="" style="display:'none' ">
<input type="text" id="t2" value="" style="display:'none' ">
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT=""><script>function dateShow(){
var index = document.getElementById("888").options.selectedIndex;
var indexValue = document.getElementById("888").options[index].text;
if(indexValue != "" && indexValue != null){
alert(indexValue)
var today = new Date();
today.setDate(today.getDate()-indexValue)
if(index == 1){
document.getElementById("t1").style.display="";
document.getElementById("t2").style.display="none";
document.getElementById("t1").value= dateOut(today);
}else{
document.getElementById("t1").style.display="none";
document.getElementById("t2").style.display="";
document.getElementById("t2").value= dateOut(today);
}
}else{
document.getElementById("t1").style.display="none";
document.getElementById("t2").style.display="none";
}
}
function dateOut(date){
var outMonth = date.getMonth()+1;
if(outMonth.toString().length == 1) outMonth = "0" + outMonth;
var outDate = date.getFullYear()+"-"+outMonth+"-"+date.getDate();
return outDate;
}
</script>
</HEAD><BODY>
<select onChange="dateShow()" id="888">
<option></option>
<option >3</option>
<option>5</option>
</select>
<table>
<tr><td height="50px">
<input type="text" id="t1" value="" style="display:'none' "></td></tr>
<tr><td>
<input type="text" id="t2" value="" style="display:'none' "></td></tr>
</table>
</BODY>
</HTML>
<select onChange="dateShow()" id="888">
<option></option>
<option >3</option>
<option>5</option>
<option>10</option>
<option>最近一个月</option>
</select> 假如是这样的呢