From b11316abe578809c32ba25994abaa48a8e49ea32 Mon Sep 17 00:00:00 2001 From: David Ashby Date: Sat, 4 Feb 2023 20:51:40 -0500 Subject: [PATCH] add a book count --- frontend/files/app.js | 3 +++ frontend/files/index.html | 1 + frontend/files/style.css | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/frontend/files/app.js b/frontend/files/app.js index 7a4451e..84a1f42 100644 --- a/frontend/files/app.js +++ b/frontend/files/app.js @@ -39,6 +39,9 @@ function renderTable(books, sortField) { var bookElement = document.getElementById("books"); bookElement.innerHTML = TableTemplate(books); + var bookCount = document.getElementById("bookCount"); + bookCount.innerHTML = `${books.length} books`; + // add listeners for selecting book to view Array.from(bookElement.querySelectorAll("tbody tr")) .slice(1) // remove header from Array diff --git a/frontend/files/index.html b/frontend/files/index.html index d674e39..7ff99a4 100644 --- a/frontend/files/index.html +++ b/frontend/files/index.html @@ -30,6 +30,7 @@ >git