Ho un semplice blocco html come:
<span id="replies">8</span>
Utilizzando jquery sto cercando di aggiungere un 1 al valore (8).
var currentValue = $("#replies").text();
var newValue = currentValue + 1;
$("replies").text(newValue);
Quello che sta succedendo è che sembra:
81
poi
811
non 9, che sarebbe la risposta corretta. Che cosa sto facendo di sbagliato?