i have a div with multiple like buttons and i have the following code where when a user press on one of the like buttons it returns the data-catid value.
$('.likes').click(function(){
var catid;
catid = $(this).attr("data-catid");
$.get('/rmb/like_image/', {like_id: catid}, function(data){
$('.likes').html(data);
$('.likes').attr('disabled','disabled');
});
});
My problem is instead of returning it to the only button that was pressed , its returning the value to all buttons. I know it has something to do with this line
$('.likes').html(data);
but i am not sure how to fix it.
Any suggestions? Thanks