• Escape the five HTML special characters so a string renders as inert text in any HTML context (element body or attribute value).

    Pure string operation — no DOM dependency.

    Parameters

    • s: string

      The string to escape.

    Returns string

    The HTML-escaped string.