html special characters decode angular code example
Example: html special characters decode angular
extratHtmlTags(content) {
return content.replace(/<[^>]*>/g, '');
}
decodeSpecialEntitiesHtml(htmlentities) {
const str = document.createElement("textarea");
str.innerHTML = htmlentities;
return str.value;
}
htmlEntitiesdecode(html){
return this.extratHtmlTags(this.decodeSpecialEntitiesHtml(html) );
}
const html = '<label for="target">My name is Pierre Yem Mback: Autres questions posées sur le système ? :</label>';
console.log(this.extratHtmlTags(this.html));
console.log(this.decodeSpecialEntitiesHtml(this.html));
console.log(this.htmlEntitiesdecode(this.html));