I have this code:
$.each(this.items, function(key, item) {
item = $(item);
item.css('background', 'red');
item.next().css('display', 'none');
}
现在,我需要使用纯JavaScript重写它,所以我正在这样做
document.getElementById(aItems[iCount].id).style.background = 'red';
document.getElementById(aItems[iCount].id).style.display = 'none';
问题在于必须对
next()
项设置display:none
,而不是这一个,我该怎么办?谢谢。