function updateCartPreview() {
  let divCartElement = document.getElementById('cartContents');
  let listElement= document.createElement('ul');
  divCartElement.appendChild(listElement);
  console.log(cart.items[0].itemSelected);
  for (let i =cart.items.length-1; i < cart.items.length; i++){
    let liElement= document.createElement('li');
    listElement.appendChild(liElement);
  listElement.innerHTML = cart.items[i].itemSelected+ ' : '+ cart.items[i].quantitySelected;  
  }
  // TODO: Get the item and quantity from the form
  // TODO: Add a new element to the cartContents div with that information
}
// TODO: As you add items into the cart, show them (item & quantity) in the cart preview div
As you add items into the cart, show them (item & quantity) in the cart preview div
As you add items into the cart show them ( item & quantity ) in the cart preview div
function updateCartPreview() {
  let divCartElement = document.getElementById('cartContents');
  let listElement= document.createElement('ul');
  divCartElement.appendChild(listElement);
  console.log(cart.items[0].itemSelected);
  for (let i =cart.items.length-1; i < cart.items.length; i++){
    let liElement= document.createElement('li');
    listElement.appendChild(liElement);
  listElement.innerHTML = cart.items[i].itemSelected+ ' : '+ cart.items[i].quantitySelected;  
  }
}
function updateCartPreview ( ) { let divCartElement = document . getElementById ( 'cartContents' ) ; let listElement = document . createElement ( 'ul' ) ; divCartElement . appendChild ( listElement ) ; console . log ( cart . items [ 0 ] . itemSelected ) ; for ( let i = cart . items . length - 1 ; i < cart . items . length ; i ++ ) { let liElement = document . createElement ( 'li' ) ; listElement . appendChild ( liElement ) ; listElement . innerHTML = cart . items [ i ] . itemSelected + ' : ' + cart . items [ i ] . quantitySelected ; } }
TODO: As you add items into the cart, show them (item & quantity) in the cart preview div
TODO : As you add items into the cart show them ( item & quantity ) in the cart preview div
// TODO: Get the item and quantity from the form // TODO: Add a new element to the cartContents div with that information