setHTML

fun setHTML(html: String, options: SetHTMLOptions = definedExternally)(source)

The setHTML() method of the Element interface provides an XSS-safe method to parse and sanitize a string of HTML and insert it into the DOM as a subtree of the element.

MDN Reference