为了账号安全,请及时绑定邮箱和手机立即绑定

JS报错:Uncaught TypeError: Cannot read property 'style' of undefined

JS报错:Uncaught TypeError: Cannot read property 'style' of undefined

云端有锋 2017-08-04 23:05:24
window.onload=function(){         "use strict";         a();b();};function a(){             "use strict";             var aLi=document.getElementsByClassName("main_list_li");             var oRank=document.getElementsByClassName("rank");             var oChange=document.getElementsByClassName("change");             for(var i=0; i<aLi.length; i++){               aLi[i].index=i;           aLi[i].onmouseover=function(){             this.style.backgroundColor="#f5f5f5";             oChange[i].style.display="block";             oRank[i].style.display="none";             };                 aLi[i].onmouseout=function(){                 this.style.backgroundColor="#ffffff";                oChange[i].style.display="none";                 oRank[i].style.display="block";                 };                 } } 第15行报错  Cannot read property 'style' of undefined
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1786 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信