Comment obtenir la valeur de la fonction A à la fonction B et alternativement? mon code est commecomment obtenir la valeur d'une fonction à une autre fonction
var $quantities = $('input.PackingCharge');
$(".prdItems tr").toggle(function() {
var totalQuantity = 0;
$(this).attr('clickedItem', '1');
//Calculate the TotalValu
$quantities.each(function() {
var GAtrr = (this.parentNode.parentNode);
if (GAtrr.getAttribute('clickeditem') == '1') {
var quantity = parseFloat(this.value);
totalQuantity += quantity;
}
});
// Total Value i hav append to the div and show the Total Value
$('#materialsCast').html(parseFloat(totalQuantity).toFixed(2));
}, function() {
// when i click this function the value not showing
console.log(totalQuantity.toFixed(2) + 'After');
// Wht are the item cliked that i clike again the value need to subtration
$quantities.each(function() {
var GAtrr = (this.parentNode.parentNode);
if (GAtrr.getAttribute('clickeditem') == '1') {
var quantity = parseFloat(this.value);
totalQuantity -= quantity;
}
});
});
Pls me aider à soustraire l'élément sélectionné lorsque nous désélectionnant.
si cela a été formaté mieux ce serait plus de chances d'obtenir une réponse – NimChimpsky