Discuss / JavaScript / 练习

练习

Topic source
var list = document.querySelector('#test-list');
for (let e of Array.from(list.children)) {
    var text = e.innerText;
    if ('JavaScript' !== text && 'HTML' !== text && 'CSS' !== text) {
        list.removeChild(e);
    }
}

  • 1

Reply