Javascript String escape_html()

Description

Javascript String escape_html()


String.prototype.escape_html = function() {
    return this.replace(/&/g, "&")
               .replace(/</g, "&lt;")
               .replace(/>/g, "&gt;")
               .replace(/"/g, "&quot;");
}



PreviousNext

Related