只要表单值发生更改,就会执行showweeks函数。它不应该只执行一次onload吗?
function showweeks() {
if (document.forms["c_form"]["frequency"].value == "daily") {
document.getElementById("c_dayint").style.backgroundColor = "#ffffff";
} else {
document.getElementById("c_dayint").style.backgroundColor = "#aaaaaa";
}
return;
}
window.onload = function() {
showweeks();
return;
};