I have to make two buttons that will change the background color onclick, the first button will change the background color to yellow and the other one will change the background color into light blue.(我必须制作两个按钮来更改onclick的背景色,第一个按钮将背景色更改为黄色,另一个按钮将背景色更改为浅蓝色。)
I have done something like this,(我做了这样的事情,)
<button id="bttn1" type="button" onclick="changeColor()">Click for a yellow color</button>
<button id="bttn2" type="button" onclick="changeColor()">Click for a light blue color</button>
function changeColor() {
document.getElementById("bttn1").style.backgroundColor = "yellow";
document.getElementById("bttn2").style.backgroundColor = "light blue";
}
ask by Tyaa Jaynar translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…