I am using the following script to find all h1 elements, within a parent ID container that will fit a curtain criteria...
$(\'#cpcompheader h1\').html(\"&nbs
If you want to remove all h1s that contains an nbsp you can try something like this: removing all elements that contains nbsp
$("h1").each(function() {
if ($(this).html().indexOf(" ") != -1) {
$(this).remove();
}
});
Now if you want to remove elements that matches exactly an nbsp just modify it as this: modified version
$("h1").each(function() {
if ($(this).html() === " ") {
$(this).remove();
}
});