Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Make an array from the HTML Collection to make it iterable

 //make an array from the HTML Collection to make it iterable
                            Array.from(books).forEach(function (book) {
                                const title = book.textContent;
                                if (title.toLowerCase().indexOf(term) != -1) {
                                    book.style.display = 'block';
                                } else { book.style.display = 'none'; }
                            })
 
PREVIOUS NEXT
Tagged: #Make #array #HTML #Collection #iterable
ADD COMMENT
Topic
Name
4+2 =