Stenli,
function escapeRegExp(string){
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
var unData = [' '];
unData.forEach(function(item) {
var regexp = new RegExp(escapeRegExp(item), "g");
$(div).html(function (a,h) {
return h.replace(regexp,'');
});
})