From f6309bb4c8357a5132a1e81634b01b8f80fa5c9e Mon Sep 17 00:00:00 2001 From: Nikhil Tanwar <2002nikhiltanwar@gmail.com> Date: Mon, 24 Jan 2022 19:23:26 +0530 Subject: [PATCH] Add span in querySelector Earlier querySelector for download button was returning a div, on which we called the getAttribute function hence returning null This now returns a element which returns the correct link with getAttribute --- static/skin/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/skin/index.js b/static/skin/index.js index 7e9e83f12..0981e8cfe 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -322,7 +322,7 @@ booksToDelete.forEach(book => {iso.remove(book);}); books.forEach((book) => { iso.insert(generateBookHtml(book, sort)) - const downloadButton = document.querySelector(`[data-id="${getInnerHtml(book, 'id')}"] .book__download`); + const downloadButton = document.querySelector(`[data-id="${getInnerHtml(book, 'id')}"] .book__download span`); if (downloadButton) { insertModal(downloadButton); }