src/index.js
// Display list of books on current Best Seller list for selected category
Display list of books on current Best Seller list for selected category
Display list of books on current Best Seller list for selected category
function displayList(books) {
        const main = document.querySelector("#review-list")
        books.forEach(bookObject => {
            const li = document.createElement('li');
            li.id = "item" + bookObject.rank
            li.innerText = bookObject.title + ", by " + bookObject.author
            main.appendChild(li);
            const saveButton = document.createElement('button');
            saveButton.setAttribute("class", "btn btn-default", "id", "save_button")
            saveButton.addEventListener('click', () => saveBook(bookObject))
            li.appendChild(saveButton)
            const item1 = document.querySelector("#item1")
        })
    }
function displayList ( books ) { const main = document . querySelector ( "#review-list" ) books . forEach ( bookObject => { const li = document . createElement ( 'li' ) ; li . id = "item" + bookObject . rank li . innerText = bookObject . title + ", by " + bookObject . author main . appendChild ( li ) ; const saveButton = document . createElement ( 'button' ) ; saveButton . setAttribute ( "class" , "btn btn-default" , "id" , "save_button" ) saveButton . addEventListener ( 'click' , ( ) => saveBook ( bookObject ) ) li . appendChild ( saveButton ) const item1 = document . querySelector ( "#item1" ) } ) }
Display list of books on current Best Seller list for selected category
Display list of books on current Best Seller list for selected category
// li.append(renderBook(bookObject)) if renderBook returns a node(element) //li.append(renderButton(bookObject)) if renderbutton returns a button node //main.append(li)