let list = document.getElementById("test-list"); let arr = list.children;
for (let i of arr) { let iText = i.innerText; if (iText != "JavaScript" && iText != "HTML" && iText != "CSS") { list.removeChild(i); } }
Sign in to make a reply
AmericanRedPomelo
let list = document.getElementById("test-list"); let arr = list.children;
for (let i of arr) { let iText = i.innerText; if (iText != "JavaScript" && iText != "HTML" && iText != "CSS") { list.removeChild(i); } }