Je suis en train de créer un total en cours d'exécution, sans succès, de quelle façon voulez-vous faire:total en cours en utilisant jQuery ne pas ajouter nombres ensemble
var total = 0;
value = $('.price').text();
total += value;
$('#subtotal span').html(total);
Tout ce que cela ajoute la valeur à côté de la « span » pas réellement ajouter les chiffres ensemble!
EDIT: Du contenu de réponse publié par OP.
$('.addtocart').click(function(){
$('#cart').show();
var omPartNo = $(this).next().text();
var supPartNo = $(this).next().next().text();
var cat = $(this).next().next().next().text();
var desc = $(this).next().next().next().next().text();
var manuf = $(this).next().next().next().next().next().text();
var list = $(this).next().next().next().next().next().next().text();
var disc = $(this).next().next().next().next().next().next().next().text();
var priceEach = $(this).next().next().next().next().next().next().next().next().text();
$('#cart table').append('<tr class="tableRow"><td><a class="removeItem" href="#"><img src="/admin/images/delete.png"></img></a><td>' + omPartNo + '</td><td>' + supPartNo + '</td><td>' + cat + '</td><td>' + desc + '</td><td>' + manuf + '</td><td>' + list + '</td><td>' + disc + '</td><td class="price">' + priceEach + '</td></tr>');
var total = 0;
value = parseInt($('.price').text(), 10);
total += value;
$('#subtotal span').html(total);
});
Ceci est mon code complet. Je pense que je fais cela mal, cela ne va pas me donner un total de course est-ce ??
Toute aide !?