You can save the interval identifier in the data attribute:
$(".post").each(function () {
var that = this;
var myInterval = setInterval(function () {
postStats(that.id);
}, 500);
$(this).data("i", myInterval);
});
and clear the interval specific to each .postas follows:
$(".button").click(function () {
clearInterval($(this).closest(".post").data("i"));
});
and, as SiGanteng said, you should pass the object to the function setInterval, not a string that only gets eval' d.