The getCueAsHTML() method of the VTTCue interface returns a DocumentFragment containing the cue content.
getCueAsHTML()
MDN Reference