$('.remove').click(function () { var postHTML = $(this).closest(".post").html(); // select only "a" element });