getHTML()
Newly available since 2024-09-16
The getHTML()
method of Element
and ShadowRoot
objects serializes an element's DOM to an HTML string.
Specifications
- HTML (#html-serialization-methods), from HTML Workstream (WHATWG).
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.
Web Platform Tests (WPT)
View the latest WPT test results for this featureView as JSON | Edit this feature | Report an issue | Web-features entry: source, dist