I am using the code below to get the value(number) inside a div and plus one but if the value is 1 and I am pressing my button it gives me 01 and I want to plus one and if it is 2 and press my button again it gives me 22.
My code is:
<div class="mybtn">0</div>
<script>
$(function() {
$(".buttonDown").click(function()
{
var checkDown = $('.buttonDown').text();
$('.mybtn').hide("fast");
$('.mybtn').text(checkDown+1);
$('.mybtn').fadeIn("slow");
});
});
</script>
See Question&Answers more detail:os