-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
24 lines (22 loc) · 794 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* eslint-disable max-classes-per-file */
// eslint-disable-next-line import/named
import Book from './modules/book.js';
import bookShelt1 from './modules/bookshelf.js';
import './modules/navBar.js';
import { displayTime, time } from './modules/currentTime.js';
const titleInput = document.querySelector('.title-input');
const authorInput = document.querySelector('.author-input');
const form = document.getElementById('forma');
displayTime.textContent = time();
setInterval(() => {
displayTime.textContent = time();
}, 1000);
form.addEventListener('submit', (event) => {
const title = titleInput.value;
const author = authorInput.value;
const book = new Book(title, author);
bookShelt1.addBook(book);
titleInput.value = '';
authorInput.value = '';
event.preventDefault();
});