<head>
<title></title>
<meta content="Microsoft Visual Studio.NET 7.0">
<link href="stylesheet1.css" type="text/css">
<script language="javascript">
var turnback=false;
function setCSS()
{
mycss.styleSheet.cssText="";
mycss.styleSheet.addImport(turnback?"stylesheet1.css":"stylesheet2.css");
turnback=!turnback;
}
</script>
</head>
<body>
StyleSheet1.CSS样式代码:
BODY
{
background-color: Black;
}
StyleSheet2.CSS样式代码:
BODY
{
background-color: maroon;
}
<button type="button">切换背景颜色</button>
</body>
</html>