PunkSktBrdr01
08-06-2003, 10:19 PM
I made this little page to test a background color switch, but I can't get it too work. I searched through a bunch of old threads, but I haven't been able to solve this. Here's my code so far:
<html>
<head>
<title>test page</title>
<script language="JavaScript">
function bgSwitch(color) {
document.background = color;
}
</script>
<style type="text/css">
body {
background:#000000;
color:#000000;
}
input {
cursor:hand;
}
</style>
</head>
<body>
<center>
<br>
<form name="switch_form">
<input type="button" name="switch_on" value="turn on the lights" onClick="bgSwitch('#FFFF00');">
<br>
<input type="button" name="switch_off" value="turn off the lights" onClick="bgSwitch('#000000');">
</form>
<br><br>
Can you see?
</center>
</body>
</html>
I tested this code in both MSIE 6 and Opera 7 on Windows ME. Thanks!
<html>
<head>
<title>test page</title>
<script language="JavaScript">
function bgSwitch(color) {
document.background = color;
}
</script>
<style type="text/css">
body {
background:#000000;
color:#000000;
}
input {
cursor:hand;
}
</style>
</head>
<body>
<center>
<br>
<form name="switch_form">
<input type="button" name="switch_on" value="turn on the lights" onClick="bgSwitch('#FFFF00');">
<br>
<input type="button" name="switch_off" value="turn off the lights" onClick="bgSwitch('#000000');">
</form>
<br><br>
Can you see?
</center>
</body>
</html>
I tested this code in both MSIE 6 and Opera 7 on Windows ME. Thanks!