Escape special characters in an HTML string.
The HTML string to escape.
The escaped HTML string.
const html = '<div class="example">Hello & welcome!</div>';// returns '<div class="example">Hello & welcome!</div>'const escaped = escapeHTML(html); Copy
const html = '<div class="example">Hello & welcome!</div>';// returns '<div class="example">Hello & welcome!</div>'const escaped = escapeHTML(html);
Escape special characters in an HTML string.