Discuss / JavaScript / 记录一下作业~

记录一下作业~

Topic source
var list=document.getElementById('test-list');
var count=0;
while(list.children.length>count){
    var text=list.children[count].innerText;
    if(text!='JavaScript' && text!='HTML' && text!='CSS'){
        list.removeChild(list.children[count]);
    }
    else{count++;}
}

  • 1

Reply