[Solved] Find div by text and delete text [closed]


Use :contains to select the div and then filter the contents and remove the node.

$("div:contains('DeleteText')").contents().filter(function () {
    return (this.nodeType == 3 && $.trim(this.nodeValue) == 'DeleteText');
}).remove();

DEMO: http://jsfiddle.net/YkEy5/

1

solved Find div by text and delete text [closed]