---
id: "gethtml"
kind: "web-feature"
canonical: "https://timetostable.com/feature/gethtml"
baseline: "low"
bcd_version: "8.1.11"
web_features_version: "3.48.0"
---

# getHTML() (`gethtml`)

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

- **Group**: DOM
- **Baseline**: Newly Available
- **Newly Available Date**: 2024-09-16
- **Specification**: https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#html-serialization-methods
- **Constituent BCD keys**: 2

## Browser Support Timeline

| Browser | Version | Release Date |
| --- | --- | --- |
| Chrome | 125 | 2024-05-14 |
| Chrome Android | 125 | 2024-05-14 |
| Edge | 125 | 2024-05-17 |
| Firefox | 128 | 2024-07-09 |
| Firefox for Android | 128 | 2024-07-09 |
| Safari | 18 | 2024-09-16 |
| Safari on iOS | 18 | 2024-09-16 |

