# stripHTMLTags

Canonical: https://www.wiki.jodisand.me/snippets/javascript/striphtmltags/


Removes HTML/XML tags from string.

- Use a regular expression to remove HTML/XML tags from a string.

```js
const stripHTMLTags = str => str.replace(/<[^>]*>/g, '');
```

```js
stripHTMLTags('<p><em>lorem</em> <strong>ipsum</strong></p>'); // 'lorem ipsum'
```


