+ var newCard = document.createElement('div');
+ newCard.classList.add('card');
+ newCard.style = 'width: 18rem;';
+ var imgLink = document.createElement('a');
+ imgLink.href = `/book/${book.bookid}`;
+ newCard.appendChild(imgLink);
+ //
+ var newImg = document.createElement('img');
+ newImg.src = book.imageurl;
+ newImg.classList.add('card-img-top', 'thumbnail', 'p-1', 'pt-3');
+ newImg.alt = '...';
+ imgLink.appendChild(newImg);
+ //
+ var cardBody = document.createElement('div');
+ cardBody.classList.add('card-body');
+ //
+ cardBody.appendChild(spaceBetween);
+ //
By: ${book.author}
+ var authorDiv = document.createElement('div');
+ authorDiv.innerText = `By: ${book.author}`;
+ //
+ cardBody.appendChild(authorDiv);
+ //
${book.department}${courseNumber}
+ var departmentDiv = document.createElement('div');
+ departmentDiv.innerText = book.department + courseNumber;
+ //
+ cardBody.appendChild(departmentDiv);
//
By: ${book.author}
- var authorDiv = document.createElement('div');
- authorDiv.innerText = `By: ${book.author}`;
- //
${book.department}${courseNumber}
- var departmentDiv = document.createElement('div');
- departmentDiv.innerText = book.department + courseNumber;
- //
- cardBody.appendChild(departmentDiv);
+ newCard.appendChild(cardBody);
//