//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'; }
})