---
name: "up.util.escapeHTML"
area: "API"
kind: "JavaScript function"
parent: "up.util module"
url: "https://unpoly.com/api/up.util.escapeHTML"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.util module](https://unpoly.com/api/up.util.md)</nav>

# up.util.escapeHTML(string)

Escapes the given string of HTML by replacing control chars with their HTML entities.

---

## Parameters {#parameters}

### string {#string}

(required)

The text that should be escaped.

Type: string

