I'm encountering this problem where I am receiving a string
const str = '<p>Please ensure Process Model diagram represents Functions adequately (boxes that represent an activity or group of activities that produce an outcome):</p><p><br></p><p><a href="https://www.google.com" rel="noopener noreferrer" target="_blank">Click here</a></p>'
<div [innerHTML]="str"></div>
I wish to remove the mentioned paragraph and other HTML elements. I have attempted using innerHTML
, but it does not seem to strip away HTML elements. I am unsure of the reason for this behavior. How can we effectively eliminate HTML elements and only display text and links?