
If is necessary to remove the html formatting to display only plain text, the following code can be used:
function StripHTML(html) {
return html.replace(/<[^>]*>?/g, "");
}
// example
var description = Xrm.Page.getAttribute("description").getValue();
var plaintext = StripHTML(description);
Xrm.Page.getAttribute("description").setValue(plaintext);
Thanks for this great bit of code. Very clean
ReplyDelete