Web platform features explorer

getHTML()

Newly available since 2024-09-16
Tags: api

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

Learning resources on MDN

Browser support