Web platform features explorer

getHTML()

Newly available since 2024-09-16
Tags: api Groups: DOM

The getHTML() method of Element and ShadowRoot objects serializes an element's DOM to an HTML string.

Learning resources on MDN

Browser support

Usage (according to Chrome Platform Status)

~0.138% of page loads. More data at chromestatus.

Specifications