I want to call Books.removeBook(${id})
inside genBookMarkup();
static genBookMarkup({
id,
title,
author,
}) {
return `<li id=${id}><p class="book_title">${title}</p>
<p class="book_author">${author}</p>
<button class="removeButton" onclick="Books.removeBook(${id})">Remove</button></li>`;
}
But getting an error:
Uncaught ReferenceError:
Books
is undefined.
How can I implement this? I don't see a way with adjacentHTML
.
Edit: I have tried to import Books but it's still not being recognized.