Escape dangerous HTML characters to prevent XSS.
The string to escape. Null or undefined returns "".
""
The HTML-escaped string, safe for use in DOM text contexts.
Sanitizes arbitrary strings against HTML injection by escaping <, >, &, ", ' to entities.
Escape dangerous HTML characters to prevent XSS.