matt matt - 1 year ago 29
HTML Question

Increment a number inside a div?

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() {

Answer Source
$('btn').click(function() {
  var el = parseInt($('.likes').text());

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download