when I click the like button the increment value incremented but it not working corresponding as the button incremented. How will do it?
index.html
<div class="row">
<div class="col-md-4">
<i class="fa fa-thumbs-up" onclick="count(this, '{{datas.id}}', '{{datas.user_id}}')" id="odd">
</i>
<span id="add"></span>
</div>
<div class="col-md-4"></div>
<div class="col-md-4 text-right">{{datas.post_date}}</div>
</div>
inbox.js
var counter=0;
function count(id, data, out)
{
counter++;
var one = id.closest('.card-body');
one.querySelector('#add').innerHTML = counter;
}
Like button increment but not start from 1 it starts from previous number
