改变select下拉框的值对页面进行改变
<script>
function timeDisplay() {
var isPermanentValue = document.getElementById("isPermanent").value;
if(isPermanentValue == 0){
document.getElementById("validityPeriod").style.display = "block";
}else {
document.getElementById("validityPeriod").style.display = "none";
}
}
</script>
div其实也有hidden属性,获取select选中的值直接定位标签取value,显示为:标签.style.display="block",隐藏为:none。