class Book { constructor(name, price) { this.name = name this.price = price } } function appendBooks() { var bookList = [new Book("1", 1),new Book("2", 2)] for (book in bookList) { var ul = document.createElement("ul") ul.classList.add("clearfix", "item-content") ul.innerHTML = '
  • \
    \
    \
    \ \ \ \ \ \
  • \
    \
  • \ \ \
  • \
    \
    \
    \
    \ ¥8699.00\ \ \ \ \ \
  • \
    \
    \
    \ \ \ \ \ \
  • \
    \

    ¥17398.00\ \ \

  • \
    \ 移入收藏夹\ 删除\ \ ' document.body.appendChild(ul) } }