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

# up.modal.extract(selector, document, options)

**This feature has been deprecated**. Use [`up.layer.open({ document, mode: &quot;modal&quot; })`](https://unpoly.com/api/up.layer.open.md) instead.

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

[Extracts](https://unpoly.com/api/up.extract.md) the given CSS selector from the given HTML string and opens the results in a modal overlay.

---

## Parameters {#parameters}

### selector {#selector}

(required)

The CSS selector to extract from the HTML.

Type: string

### document {#document}

(required)

The HTML containing the modal content.

Type: string

### options {#options}

(required)

See options for [`up.modal.follow()`](https://unpoly.com/api/up.modal.follow.md).

Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)

---

## Return value {#return-value}

A promise that will be fulfilled when the modal has been opened.

Type: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)

