How to remove all <wbr> tags on page

1.1k Views Asked by At

I'm trying to make a chrome extension for youtube comments, but when I add some stuff it keeps adding

<wbr></wbr> 

tags, is there any way to remove all of those tags on the page in javascript?

1

There are 1 best solutions below

5
On BEST ANSWER

The easiest way is:

var wbrs = document.getElementsByTagName('wbr');

while (wbrs.length) {
    wbrs[0].parentNode.removeChild(wbrs[0]);
}

JS Fiddle demo.