0

I have shopping cart who comes in lightbox, but on this button to call shop cart i have number of added products, I count my div elements (added products) with: .length, and that is ok. but how can i count this elements live, if i click on "add to cart" then should automaticly number of products increase.

At the moment my code look like following

var elementsInCart =  $('div.cartelements div.cartproducts');

$('#call_cart_button_number').html(elementsInCart);

I see always true number of products if i refresh page. I have tried to solve this with click, but that's not true.

I have found some other examples, but there is always something others. jQuery counter to count up to a target number

4

0 回答 0