#JavaScript - Escape HTML
function escapeHTML(text) {
var replacements = {"<": "<", ">": ">", "&": "&", "\"": """};
return text.replace(/[<>&"]/g, function(character) {
return replacements[character];
});
}
#JavaScript - Escape HTML
function escapeHTML(text) {
var replacements = {"<": "<", ">": ">", "&": "&", "\"": """};
return text.replace(/[<>&"]/g, function(character) {
return replacements[character];
});
}