함수 A에서 값을 functon B로 바꾸는 방법 또는? 내 코드 Pls는 우리가 선택 해제되어 선택한 항목을 뺀하는 데 도움이한 함수에서 다른 함수로 값을 가져 오는 방법
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;
}
});
});
같다.
이가 그것을 얻을 가능성이있을 것입니다 더 나은 포맷 된 경우 응답 – NimChimpsky