I am trying to pass new object as parameter in static function but i getting unexpected result. Here is my code. But i want to show table row with title name, author name and isbn. So help to resolve this problem.
let bookTitle = document.querySelector("#title").value;
let bookAuthor = document.querySelector("#author").value;
let bookIsbn = document.querySelector("#isbn").value;
class Book {
constructor(title, author, isbn) {
this.title = title;
this.author = author;
this.isbn = isbn;
}
}
const makeNewBook = new Book(bookTitle, bookAuthor, bookIsbn);
class MakeUi {
static addTable(makeNewBook) {
document.querySelector("#book-list").innerHTML = `<tr>
<td> ${title} </td>
<td> ${author} </td>
<td> ${isbn} </td>
<td> <button class="btn btn-sm btn-danger"> X </button> </td>
</tr>`;
}
}
MakeUi.addTable();
