Babiker's solution works. Alternatively you can do this:
$("div").each(function(index, elem) {
if ($(elem).attr("id") == "*xxx." || $(elem).attr("id") == ".xxx*") {
$(elem).remove();
}
});
Or even better, this:
$("#\\*xxx\\.").remove();
$("#\\.xxx\\*").remove();