日期:2014-05-16 浏览次数:20401 次
function changeColor() {
if (document.body.bgColor == "red") {
document.body.bgColor = "white";
}
else {
document.body.bgColor = "red";
}
}
function changeColor1() {
if (document.body.bgColor == "white") {
document.body.bgColor = "red";
}
else {
document.body.bgColor = "white";
}
}
<input type="button" value="改变颜色" onclick="changeColor()" />
<input type="button" value="改变颜色1" onclick="changeColor1()" />