// 遍历siblings兄弟节点
function sibling(s) {
let siblingsArr = [];
let b = s.parentNode.children;
for(let i = 0, bl = b.length; i < bl; i++){
if(b[i] !== s){
siblingsArr.push(b[i])
}
}
return siblingsArr;
}
网友评论