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.

Specifications

Browser support

  • Chrome 125 Released on 2024-05-14
  • Chrome Android 125 Released on 2024-05-14
  • Edge 125 Released on 2024-05-17
  • Firefox 128 Released on 2024-07-09
  • Firefox for Android 128 Released on 2024-07-09
  • Safari 18 Released on 2024-09-16
  • Safari on iOS 18 Released on 2024-09-16

Usage (according to Chrome Platform Status)

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