This works fine:
$('a.popupCloseClass').click(function() {
var id = $(this).parent().attr('id');
});
JSFiddle Demo
You should just use this
instead of the way you are getting the ID and then trying to use it as a selector (you were missing the #
before the ID):