if(var btn=document.getElementById("btn").onmouseover?btn.style.background="blue");
1 回答
已采纳

李晓健
TA贡献1036条经验 获得超461个赞
css 直接搞定的东西,不需要用js
#btn:hover{background-color: blue;}
非要用js的话
document.getElementById("btn").onmouseover = function{this.style.background="blue"}
添加回答
举报
0/150
提交
取消