I’m having problems with incremental values without refreshing the page using jquery.
I have html code that does this.
<li class=''>
<img src="../icons/fav_c.png" width='12' style='vertical-align:middle;'/>
<div style='float:right;padding-top:2px;width:5px'>
<span class='selector'>
<?php echo $value; ?>
</span>
</div>
</li>
I have a code that does in jquery.
val value = $('span.selector').text();
$('span.selector').text(value++);
This is not affecting my value that is being echo’d out?
Can anyone see what the problem is? Does .text() not work?
Thanks!
Ok:
) parseInt with radix
with out it ’09’ for example would be 0. Converts string to an integer
) ++value – increment value before it’s applied to .text(…). value++ would call text() first then increment.