this.className为什么不能写成Lis[i].className
就是视频中的这段代码,有点费解,求指点
window.onload = function () {
// 编写JS代码
Lis = document.getElementsByTagName("li");
for(i=0; i<Lis.length; i++){
Lis[i].onmouseover = function(){
this.className = "lihover";
}
Lis[i].onmouseout = function(){
this.className = "";
}
}
}