我想弄清楚如何使用按钮来改变页面的背景颜色代码javascript更改页面背景颜色的按钮
所以基本上我有一个代码写出来的按钮和它的功能,但有问题搞清楚用什么代码,以使按钮改变整个页面
<script>
function changeColor()
{
};
function changeText()
{
alert ("change text in this part");
};
function sendMsg()
{
alert ("change msg content here");
}
</script>
<body>
<h1>Welcome to my program!</h1>
<button onclick="changeColor()">Color</button>
<button onclick="changeText()">Text</button> </br>
<p>Can I ask you something Ive always wanted to ask the real Batman?</p> </br>
<input type="text" name="">
</body>
您可以通过搜索引擎获取互联网上的答案:http://stackoverflow.com/questions/197748/how-do-i-change-the-background -color-with-javascript – 2013-04-05 01:38:12
非常感谢你一直在寻找45分钟,每一次搜索都给我带来了如何改变按钮的颜色,而不是背景 – 2013-04-05 01:47:00