If you have several lines you must use a class attribute instead of an id attribute for the case of #likeClick, use the class .community-post-like-button ids should not be repeated in a same HTML document. Your code would look like this then.
HTML
<div class='community-post-like-button' id='likeClick' data-value='{$id}'>Like Me</div>
JavaScript
$(document).ready(function() { $('.community-post-like-button').click(function(){ var id = $(this).data('value'); $.ajax({ url: '../resources/handlers/like.php', type: 'POST', data: {id: id}, cache:false, success: function(data) { $('#likeNumber').html(data); } }); }); });