---
title: getDocumentForElement
subpath: pota/use/dom
topic: Internals
desc:
  The owning Document or ShadowRoot — works for disconnected and
  shadow nodes.
---

# getDocumentForElement

`getDocumentForElement(node)` returns the owning `Document` or
`ShadowRoot` — it works for disconnected nodes and for nodes inside a
shadow tree. Part of [`pota/use/dom`](/use/dom).
