I have this script that here that I'll program later to continously change the background color, but for some reason it does not work at all. It's not throwing any errors either
<html>
<body id = "BGCOLOR" bgcolor = rgb(0,0,0); >
<script>
function ChangeColor(){
document.getElementById("BGCOLOR").bgcolor = "rgb(0,50,0)";
}
ChangeColor();
</script>
</body>
</html>
document.body.style.backgroundColor = "red";
有关更多参考,请访问http://www.w3schools.com/jsref/prop_style_backgroundcolor.asp
friend try this code
<html>
<body id = "BGCOLOR" bgcolor = rgb(0,0,0); >
<script>
function ChangeColor(){
document.body.style.backgroundColor = "rgb(0,50,0)";
}
ChangeColor();
</script>
</body>
</html>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.