Ver Mensaje Individual
  #14 (permalink)  
Antiguo 23/07/2015, 23:02
pandora09
 
Fecha de Ingreso: julio-2015
Mensajes: 16
Antigüedad: 8 años, 9 meses
Puntos: 1
Respuesta: Al ejecutar RemoveChild restar valor al total

Bueno ya esta listo, ya esta parte del código funciona y hace lo que necesitaba muchas gracias Alexis88 por tu ayuda y paciencia

Así quedo

Código Javascript:
Ver original
  1. campo5.onclick = function() {
  2.        
  3.             var fila = this.parentNode.parentNode;
  4.             var tbody = tabla.getElementsByTagName("tbody")[0];
  5.             var total = document.getElementById("total");
  6.             subtotal = fila.querySelector("#totalitem");
  7.             if (total.innerHTML == 'NaN') {
  8.             total.innerHTML = 0;
  9.             }
  10.  
  11.             total.innerHTML = (Number(total.innerHTML)-Number(subtotal.value)).toFixed(2);
  12.  
  13.             tbody.removeChild(fila);
  14.  
  15.             }