Is it possible to use jquery to add numbers taken from mysql?
- by Scarface
Hey guys quick question. I have a div that gets assigned a number to its id that is taken from the database on page load. I am trying to use jquery to add 1 to that number but for example if the number was 70 to begin with it just becomes 701. Anyone know what I am doing wrong?
echo "<div class=\"total\" id=\"$total\">$total</div>";
var total=$(".total").attr("id");
var newtotal=total+1;
$('.total').html(newtotal);