谁能告诉我这有什么问题:
<html>
<script type = "text/javascript">
function colourGreen()
{
document.getElementById("button1").style.bgColor = 0xFFFF00;
}
</script>
<body>
<form action="">
<div id = "button1">
<input type="button" value="Colour">
</div id>
<div id = "button2">
<input type="button" value="Price up" onclick = "colourGreen()">
</div id>
<div id = "button3">
<input type="button" value="Price down">
</div id>
</form>
</body>
</html>
最佳答案
document.getElementById("button1").style.backgroundColor = '#FFFF00';
关于改变按钮颜色的Javascript函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3161154/