---
name: "up.viewport.get"
area: "API"
kind: "JavaScript function"
parent: "up.viewport module"
url: "https://unpoly.com/api/up.viewport.get"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.viewport module](https://unpoly.com/api/up.viewport.md)</nav>

# up.viewport.get(target)

Returns the scrolling container for the given element.

Returns the [document's scrolling element](https://unpoly.com/api/up.viewport.root.md) if no closer viewport exists.

---

## Parameters {#parameters}

### target {#target}

(required)

Type: string | [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) | [jQuery](https://learn.jquery.com/using-jquery-core/jquery-object/)

---

## Return value {#return-value}

Type: [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element)

