Web platform features explorer

Sanitizer API

The Document.parseHTML() static method and the setHTML() method of Element and ShadowRoot objects 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

MDN documentation

Browser support

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