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

# up.element.all([parent], selector)

**This feature has been deprecated**. Use [`Document#querySelectorAll()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) or [`Element#querySelectorAll()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelectorAll) instead

Load [`unpoly-migrate.js`](https://unpoly.com/changes/upgrading.md) to polyfill deprecated features.

Returns all descendant elements matching the given selector.

---

## Parameters {#parameters}

### [parent=document] {#parent}

(optional)

The parent element whose descendants to search.

If omitted, all elements in the `document` will be searched.

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

### selector {#selector}

(required)

The CSS selector to match.

Type: string

---

## Return value {#return-value}

A list of all elements matching the selector.

Returns an empty list if there are no matches.

Type: [List](https://unpoly.com/api/List.md)<[Element](https://developer.mozilla.org/en-US/docs/Web/API/Element)>

