全部代码如下,测试通过.
select 的onchange="change();"
function change(){
var name=document.getElementById("s1").value;
if(name=='week'){
document.getElementById("t1").style.display="";
document.getElementById("t2").style.display="none";
document.getElementById("t3").style.display="none";
}else if(name=='month'){
document.getElementById("t1").style.display="none";
document.getElementById("t2").style.display="";
document.getElementById("t3").style.display="none";
}else if(name=='year'){
document.getElementById("t1").style.display="none";
document.getElementById("t2").style.display="none";
document.getElementById("t3").style.display="";
}
}