Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

filter htmlcollection

const existingElements = document.querySelectorAll(".chapter-list-item");

const chapters = Array.from(existingElements)
  .filter(chapter => !chapter.classList.contains("active"))

console.log("Found elements:")
for (const chapter of chapters) {
  console.log(chapter.textContent, chapter.className)
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filter #htmlcollection
ADD COMMENT
Topic
Name
5+3 =