Javascript String htmlEntities()
String.prototype.htmlEntities = function() { return this.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"'); }
String.prototype.htmlEntities = function() { return this.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/'/g, ''').replace(/"/g, '"'); };