Javascript String htmlUnEscape()

Description

Javascript String htmlUnEscape()

String.prototype.htmlUnEscape = function () {
    var escapedStr = String(this).replace(/&/g, '&');
    escapedStr = escapedStr.replace(/&lt;/g, '<');
    escapedStr = escapedStr.replace(/&gt;/g, '>');
    escapedStr = escapedStr.replace(/&quot;/g, '"');
    escapedStr = escapedStr.replace(/&#39/g, "'");
    return escapedStr;
}



PreviousNext

Related