js/cart.js
// TODO: Fill in the <tr>'s under the <tbody> for each item in the cart
Fill in the 's under the  for each item in the cart
Fill in the ' s under the for each item in the cart
function showCart() {
  var tBodyEl = document.getElementById('cart').children[1];
  for (var i in cart.items){
    var trEl = document.createElement('tr');
    tBodyEl.appendChild(trEl);
    var tdRemove = document.createElement('td');
    tdRemove.textContent = 'X';
    trEl.appendChild(tdRemove);
    var tdQuantity = document.createElement('td');
    tdQuantity.textContent = cart.items[i].quantity;
    trEl.appendChild(tdQuantity);
    var tdProduct = document.createElement('td');
    tdProduct.textContent = cart.items[i].product;
    trEl.appendChild(tdProduct);
  }
}
function showCart ( ) { var tBodyEl = document . getElementById ( 'cart' ) . children [ 1 ] ; for ( var i in cart . items ) { var trEl = document . createElement ( 'tr' ) ; tBodyEl . appendChild ( trEl ) ; var tdRemove = document . createElement ( 'td' ) ; tdRemove . textContent = 'X' ; trEl . appendChild ( tdRemove ) ; var tdQuantity = document . createElement ( 'td' ) ; tdQuantity . textContent = cart . items [ i ] . quantity ; trEl . appendChild ( tdQuantity ) ; var tdProduct = document . createElement ( 'td' ) ; tdProduct . textContent = cart . items [ i ] . product ; trEl . appendChild ( tdProduct ) ; } }
TODO: Fill in the <tr>'s under the <tbody> for each item in the cart
TODO : Fill in the <tr > ' s under the <tbody > for each item in the cart
// TODO: Find the table body // TODO: Iterate over the items in the cart // TODO: Create a TR // TODO: Create a TD for the delete link, quantity,  and the item // TODO: Add the TR to the TBODY and each of the TD's to the TR