diff --git a/files/en-us/web/api/document/index.md b/files/en-us/web/api/document/index.md index 1a334d06ac8b03e..6592b38d8db382c 100644 --- a/files/en-us/web/api/document/index.md +++ b/files/en-us/web/api/document/index.md @@ -305,6 +305,14 @@ The `Document` interface for HTML documents inherit from the {{DOMxRef("HTMLDocu - {{DOMxRef("Document.writeln()")}} - : Writes a line of text in a document. +## Static methods + +_This interface also inherits from the {{DOMxRef("Node")}} and {{DOMxRef("EventTarget")}} interfaces._ + +- {{domxref("Document/parseHTMLUnsafe_static", "Document.parseHTMLUnsafe()")}} + - : Creates a new `Document` object from a string of HTML without performing sanitization. + The string may contain declarative shadow roots. + ## Events Listen to these events using `addEventListener()` or by assigning an event listener to the `oneventname` property of this interface. In addition to the events listed below, many events can bubble from {{domxref("Node", "nodes", "", "nocode")}} contained in the document tree. diff --git a/files/en-us/web/api/document/parsehtmlunsafe_static/index.md b/files/en-us/web/api/document/parsehtmlunsafe_static/index.md new file mode 100644 index 000000000000000..d5ef29ba0b04591 --- /dev/null +++ b/files/en-us/web/api/document/parsehtmlunsafe_static/index.md @@ -0,0 +1,47 @@ +--- +title: "Document: parseHTMLUnsafe() static method" +short-title: parseHTMLUnsafe() +slug: Web/API/Document/parseHTMLUnsafe_static +page-type: web-api-static-method +browser-compat: api.Document.parseHTMLUnsafe_static +--- + +{{APIRef("DOM")}} + +The **`parseHTMLUnsafe()`** static method of the {{domxref("Document")}} object is used to parse a string of HTML, which may contain [declarative shadow roots](/en-US/docs/Web/HTML/Element/template#declarative_shadow_dom), in order to create a new {{domxref("Document")}} instance. + +The suffix "Unsafe" in the method name indicates that, while `