Web platform features explorer

Sanitizer API

The parseHTML() method for the Document interface and the setHTML() methods for the Element and ShadowRoot interfaces parse and insert HTML into the DOM in a way that can prevent cross-site scripting attacks. The Sanitizer API can customize the sanitization process.

Status

Limited availability

Browser support

  • Chrome
  • Chrome Android
  • Edge
  • Firefox
  • Firefox for Android
  • Safari
  • Safari on iOS