Back to all features
Open for signals DOM

HTML setter methods

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

Modern Web Guidance

How Modern Web Guidance uses this feature

Sets HTML directly into existing elements with native performance and optional script execution through imperative methods like setHTMLUnsafe(), supporting out-of-order partial page updates alongside declarative <template for> patching.

Recommended fallback strategy

Load the template-for-polyfill and html-setters-polyfill polyfills to emulate the API surface in non-supporting browsers.

Community use cases (0)

No use cases submitted yet

Be the first developer to describe your production use case and shape browser priorities!