Escapes special HTML characters in a string to their corresponding HTML entities.
Characters escaped: &, <, >, ", '.
&
<
>
"
'
The string to escape.
The escaped string safe for HTML usage.
1.1.0
escapeHtml('<div class="test">Hello & Welcome</div>');// Returns: '<div class="test">Hello & Welcome</div>' Copy
escapeHtml('<div class="test">Hello & Welcome</div>');// Returns: '<div class="test">Hello & Welcome</div>'
Escapes special HTML characters in a string to their corresponding HTML entities.
Characters escaped:
&
,<
,>
,"
,'
.