<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>动态改变网页背景颜色</title>
    
<Script language="JavaScript">
//设置颜色
var a00 = "FFFBD0";
var a01 = "FF0000";
var a02 = "FF8080";
var a03 = "FF8000";
var a04 = "FFFF00";
var a05 = "000080";
//改变北京颜色
function changebg(type){
document.bgColor = type;
}
</script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <input id="Button1" type="button" onClick="changebg(a00)" style="background-color: rgb(255,251,208)" />&nbsp;
        <input id="Button2" type="button"  onClick="changebg(a01)" style="background-color: rgb(255,0,0)"/>&nbsp;
        <input id="Button3" type="button"  onClick="changebg(a02)" style="background-color: rgb(255,128,128)"/>&nbsp;
        <input id="Button4" type="button"  onClick="changebg(a03)" style="background-color: rgb(255,128,0)"/>&nbsp;
        <input id="Button5" type="button"  onClick="changebg(a04)" style="background-color: rgb(255,255,0)"/>&nbsp;
        <input id="Button6" type="button"  onClick="changebg(a05)" style="background-color: rgb(0,0,128)"/>
        
        </div>
    </form>
    <p>
        &nbsp;</p>
</body>
</html>
