Hi I dont undrestand what ur trying to do exactly. but from my understanding
ur trying to take the html value of duration class ans increment it by 1 and
then again put back the html value like...

<div class="duration">1</div>
<div class="duration">2</div>
<div class="duration">3</div>
<div class="duration">4</div>

So after looping it should be 
<div class="duration">2</div>
<div class="duration">3</div>
<div class="duration">4</div>
<div class="duration">5</div>

Is this what ur trying to do. Ur loop will do exactly what I said.

Jan-86 wrote:
> 
> 
> Hi,
> 
> I'm experiencing a problem with each():
> 
> function CalculateDuration() {
>       $(".duration").each(function() {
>               var dur = $(this).html();
>               dur++;
>               $(this).html(dur);
>       });
>  }
> 
> This function should take the value of fields tagged with .duration
> and augment them by one.  Currently it's augmenting them with the
> number of times it finds .duration (ie.: if I have 5 fields with class
> duration, it will add 5 instead of 1 to each field).
> 
> Any suggestions on how to solve this would be more than welcome.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-each%28%29-tf4626294s27240.html#a13214326
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to