Reputation: 61
I have JSON file like
[{"description":"<p> example...</p> </br> <p>paragraph... </p> <div id="test" class="test2" style="left: -10000px; top: 10px; position:absolute;"> <p>paragraph... </p> "}]
So how can I remove the HTML tage such as <p> </p>
</br>
to display in ionic-framework
Upvotes: 3
Views: 3959
Reputation: 4578
If you can't use an HTML parser oriented solution to filter out the tags, here's a simple regex for it.
var noHTML = OriginalString.replace(/(<([^>]+)>)/ig,"");
Upvotes: 1