请教一下大神,这里为什么是这样写的?
trs[i].onmouseover = function() {
this.style.backgroundColor = "#f2f2f2";
}
trs[i].onmouseout = function() {
this.style.backgroundColor = "#fff";
}
trs[i].onmouseover = function(){}这里的onmouseover和onmouseout不是可以写在<a>标签内吗?为什么要写成函数啊?