HTML setter methods

Limited availability

The setHTML(), replaceWithHTML(), beforeHTML(), prependHTML(), appendHTML() and afterHTML() DOM methods, and unsafe equivalents, insert HTML into an existing tree.

Browser support

  • Chrome 157 Released on 2026-11-03
  • Chrome Android 157 Released on 2026-11-03
  • Edge 157 Released on 2026-11-05
  • Firefox Not supported Bugs: 2075152
  • Firefox for Android Not supported
  • Safari Not supported Bugs: 303808
  • Safari on iOS Not supported Bugs: 303808

Need this feature?
Leave a 👍 on the feedback issue
Don't forget to also leave a comment explaining your specific use case.