You can try the followin -
HTML
<pre><input type="button" class="btn btn-primary btn-sm" id="testbtn" value="LIKE">
<div id="output">0</div>
Java
$(function() {
$('#testbtn').click(function() {
$('#output').html(function(i, val) {
return val * 1 + 1;
});
});
});
Just add your other required code or if blocks as required.