【发布时间】:2013-03-27 07:29:38
【问题描述】:
我正在试图弄清楚如何使用按钮更改页面背景颜色的代码
所以基本上我已经写出了一个按钮的代码及其功能,但是我无法弄清楚使用什么代码来使按钮改变整个页面的颜色
<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>
【问题讨论】:
-
您可以通过搜索引擎在互联网上获得答案:stackoverflow.com/questions/197748/…
-
非常感谢,我已经搜索了 45 分钟,每次搜索都让我知道如何更改按钮的颜色而不是背景
标签: javascript button background-color