var count_audio_post = $('#count_audio_post').text(); 

Receives text

 <span id="count_audio_post" style="display:none">0</span> 

And then when I work with a variable, then in this case instead of 1 , 01 appears, then 011 , etc.

 $('#count_audio_post').text(count_audio_post+1); 

    1 answer 1

    You just need to convert to int :

     var count_audio_post = Number($('#count_audio_post').text()); $('#count_audio_post').text(count_audio_post+1);