i have this
<div class="likes">13</div>
and I want to increment this number by +1 when I click a button
How can I do that with jQuery?
$('btn').click(function() {
$('.likes').text();
});
$('btn').click(function() {
var el = parseInt($('.likes').text());
$('.likes').text(el+1);
});
http://jsfiddle.net/jg5GA/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With