var block = ev.currentTarget.parentNode.childNodes;
for(var i = 0;i<block.length;i++){
block[i].backgroundColor = "#000000";
}
上面这样写是木得效果滴。要加上.style
解决方法:
var block = ev.currentTarget.parentNode.childNodes;
for(var i = 0;i<block.length;i++){
block[i].style.backgroundColor = "#000000";
}