Is There a Way to Remove Html Tags from a String in Javascript? [Duplicate]
I Am Working with the Rich Text Editor Component of Primeng. This Editor Turns Everything I Type in into Html. but Sometimes I Want to Output These Texts in...
I am working with the rich text editor component of primeng. This editor turns everything i type in into html. But sometimes i want to output these texts in plain text instead. Does angular 2 provide a way to easily remove the html tags from the text?
Thank you.
1 Answer
You can achieve this by JavaScript.
Try this!!
var plainText = content.replace(/<[^>]*>/g, '');
This will return you plain text.