1521739808
This commit is contained in:
parent
232145c7ee
commit
e0b2370cef
15
app.js
15
app.js
@ -12,18 +12,25 @@ function genBookId() {
|
||||
return lastBookId++;
|
||||
}
|
||||
|
||||
let books = {}
|
||||
let books = {};
|
||||
|
||||
function addBook(event){
|
||||
event.preventDefault();
|
||||
console.log("Add Book", event.target.bookTitle.value);
|
||||
let bookId = genBookId();
|
||||
|
||||
let book = {
|
||||
title: event.target.bookTitle.value,
|
||||
genre: event.target.bookGenre.value,
|
||||
desc: event.target.bookDesc.value
|
||||
}
|
||||
|
||||
let row = `
|
||||
<tr id="bookRow${bookId}">
|
||||
<td>${bookId + 1}</td>
|
||||
<td>${event.target.bookTitle.value}</td>
|
||||
<td>${event.target.bookGenre.value}</td>
|
||||
<td>${event.target.bookDesc.value}</td>
|
||||
<td>${}</td>
|
||||
<td>${}</td>
|
||||
<td>${}</td>
|
||||
<td>
|
||||
<button onclick="editBook(${bookId})">Edit</button>
|
||||
<button onclick="deleteBook(${bookId})">Delete</button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user