增加显示的喜欢量(自定义的,而不是Facebook)

I would like to display total amount of likes on page, the likes are displayed in:

<input type="tekst" id="<?php echo $item->getId();?>">

add like function button:

 $(function () {
                        $('a.like').on('click', function () {
                            var url = $(this).attr('href');
                            $.post(url, {}, function () {
                            });
                            return false;
                        });
                    });

So not I have to click on $('a.like') and then refresh page to see the like added, I would like to skip refreshing the page. Any ideas?

EDIT there is also a script:

<script>
                    document.getElementById("<?php echo $item->getId();?>").value =<?php echo getVotesValue($item->getId());?>
                </script>

If I understand correctly, you need to replace your code by this:

var likesCounter = $('#<?php echo $item->getId();?>');
$(function () {
    $('a.like').on('click', function () {
        var url = $(this).attr('href');
        $.post(url, {}, function () {
            likesCounter.val(parseInt(likesCounter.val()) + 1);
        });
        return false;
    });
});