I have this column of a table in html
which I need to do a total sum and the result insert it a input
text type
td(class='sumTtotal')
This is my td where each result of the dif $
What I was trying to do is to take the value of each td and add it to an array and then add it all up
$(function() {
var arrText = new Array();
$('.sumaTotal').find("td").map(function() {
arrText.push($(this).val());
});
console.log(arrText);
});
But it does not bring me any information
This is the table which is in Jade
table(id='table-preAjuste' class='table table-striped table-hover table-condensed analisisD')
thead
tr
th='Articulo'
th='Descripción'
th='Um'
th='Ov'
th='Ubic'
th='Ubic F'
th='Teorico'
th(class='vi1')='Conteo1'
th(class='vi2')='Conteo2'
th(class='vi3')='Conteo3'
th='Dif'
th='Dif'
th='Dif $'
th(class='vi3')='Asignar conteo'
th='Ajustar'
input(type="checkbox" id='selectall')
th='Reversar'
tbody
if PreAjuste != undefined
each PArticulos in PreAjuste
tr
td(id='id_articulo' class='iarticulo')= PArticulos.SI_Articulo
td= PArticulos.SI_Descripcion
td= PArticulos.SI_UM
td= PArticulos.SI_OV
td= PArticulos.SI_Ubicacion
td= PArticulos.SI_Ubicacion_Fisica
td= PArticulos.SI_Existencia
td(class='vi1')= PArticulos.SI_Cantidad
td(class='vi2')
td(class='vi3')
td= PArticulos.SI_Dif
td(contenteditable='true')
td(class='sumTtotal')= PArticulos.SI_Dif_Dinero
and so the table looks