Is it possible to remove '&nbsp' using JQuery..?

No, you would do something along these lines:

$("td").html(function (i, html) {
    return html.replace(/ /g, '');
});

Rather than answering the OP's specific scenario, if we take the question title ("Is it possible to remove '&nbsp' using JQuery..?") and answer this in a general way (which I think is useful), then any answers using .html() have one fundamental flaw: replacing the html this way also removes any data and event handlers associated with the old html - not desirable! It may work for the OP's specific scenario, but I think it's useful to answer the question in a more general way...

The better way is to replace the .textContent of individual text nodes within the element. So given the following markup:

<div class="container">
    &nbsp;<a href="www.google.com">Here is a link &nbsp;</a>
    <p>Here is a paragraph with another link inside: <a href="www.facebook.com">&nbsp;&nbsp;another link&nbsp;</a>&nbsp;</p>
    And some final text &nbsp;&nbsp;&nbsp;&nbsp;
</div>

We can remove all &nbsp; (which is unicode \u00A0 - see more about this here) like so:

$('.container, .container *').contents().each(function() {
    if (this.nodeType === 3) { // text node
        this.textContent = this.textContent.replace(/\u00A0/g, '');
    }
});

$('.container, .container *') selects the container and all elements inside it, then .contents() selects all the children of those elements, including text nodes. We go through each of those nodes, and for every text node we encounter (nodeType === 3), we replace the &nbsp; (\u00A0) with an empty string.


NBSP is not an element, so you can't hide it.

What you could do is to rewrite the element which contains NBSP... like this:

 $('#container').html( $('#container').html().split('&nbsp').join('') );

Also detecting where NBSP using jquery.contains and setting it's parent element a class with font size 0 or display none could do the trick.

Note than if you choose to rewrite the HTML to erase unwanted NBSP all events previously attached will be removed.