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