编辑下面的代码:【加编码】
<html> <body> <p>点击按钮修改背景颜色。</p> <button id="myBtn">点我</button> <script> document.getElementById("myBtn").addEventListener("click", function(){ this.style.backgroundColor = "red"; }); </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂