getHTML()
Newly available since 2024-09-16
The getHTML()
method of Element
and ShadowRoot
objects serializes an element's DOM to an HTML string.
Learning resources on MDN
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
Specifications
- HTML Standard (#html-serialization-methods), from HTML Workstream (WHATWG).