Im trying to sum the spans individually and put the result in the label totalCount. I have sucess on that but I think this code is too long and is not so good because if I have 20 sections I have to do that (jquery) 20 times:S. If you guys could help.
<div>
<section class="ac-container">
<div>
<input id="ac-1" name="accordion-1" type="checkbox" />
<label for="ac-1">09:00 - (<span id="totalCount"></span> places)</label>
<article class="ac-small">
<a href="panier.html"> 09:00 - (<span id="horaireCount">25</span> places)</a>
</article>
<article class="ac-small">
<a href="panier.html"> 09:30 - (<span id="horaireCount2">12</span> places)</a>
</article>
</div>
</section>
</div>
<div>
<section class="ac-container">
<div>
<input id="ac-2" name="accordion-2" type="checkbox" />
<label for="ac-2">10:00 - (<span id="totalCount2"></span> places)</label>
<article class="ac-small">
<a href="panier.html"> 10:00 - (<span id="horaireCount3">25</span> places)</a>
</article>
<article class="ac-small">
<a href="panier.html"> 10:30 - (<span id="horaireCount4">25</span> places)</a>
</article>
</div>
</section>
</div>
<div>
<section class="ac-container">
<div>
<input id="ac-3" name="accordion-3" type="checkbox" />
<label for="ac-3">11:00 - (<span id="totalCount3"></span> places)</label>
<article class="ac-small">
<a href="panier.html"> 11:00 - (<span id="horaireCount5">25</span> places)</a>
</article>
<article class="ac-small">
<a href="panier.html"> 11:30 - (<span id="horaireCount6">5</span> places)</a>
</article>
</div>
</section>
</div>
// sum of places for hour for the first 3 boxs
var count = parseInt ($("#horaireCount").text());
var count2 = parseInt ($("#horaireCount2").text());
var total = count + count2;
$("#totalCount").text(total);
var count = parseInt ($("#horaireCount3").text());
var count2 = parseInt ($("#horaireCount4").text());
var total = count + count2;
$("#totalCount2").text(total);
var count = parseInt ($("#horaireCount5").text());
var count2 = parseInt ($("#horaireCount6").text());
var total = count + count2;
$("#totalCount3").text(total);