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

# up.layer.contains(element)

Returns whether the given `element` is contained by the [current layer](https://unpoly.com/api/up.layer.current.md).

This is a shortcut for `up.layer.current.contains(element)`. See [`up.Layer#contains`](https://unpoly.com/api/up.Layer.prototype.contains.md) for more documentation.

---

## Parameters {#parameters}

### element {#element}

(required)

The element to test.

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

---

## Return value {#return-value}

Whether the layer contains the element.

Type: boolean

