快捷导航

为什么用法setAttribute不能改变颜色呢???

window.onload = function(){  var mytr=document.getElementsByTagName("tr");  for(var i=0;i

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员2

setAttribute 复制代码的时候记得看清 你里面的代码是 getAttribute
回复

使用道具 举报

mytr.setAttribute("onmouseover","this.style.backgroundColor='red'");//set不是get
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP