---
name: "up:fragment:kept"
area: "API"
kind: "DOM event"
parent: "up.fragment module"
visibility: "experimental"
url: "https://unpoly.com/api/up:fragment:kept"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.fragment module](https://unpoly.com/api/up.fragment.md)</nav>

# up:fragment:kept

**This feature is experimental**. Please [share](https://github.com/unpoly/unpoly/discussions) your experiences so we know what to keep or change.

The `up:fragment:kept` event is emitted _after_ an existing element has been [kept](https://unpoly.com/learn/keeping-elements.md) during a render pass.

All [keep conditions](https://unpoly.com/learn/keeping-elements.md#conditions) have already been evaluated. The keeping can no longer be prevented. For this, use [`up:fragment:keep`](https://unpoly.com/api/up:fragment:keep.md) instead.

<nav aria-label="Guides">

- [Learn: Keeping elements](https://unpoly.com/learn/keeping-elements.md)

</nav>

---

## Event properties {#properties}

### event.target {#event.target}

(required)

The fragment that has been kept.

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

### event.newFragment {#event.newFragment}

(required)

The response fragment that has been discarded.

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

### event.newData {#event.newData}

(required)

The [data](https://unpoly.com/learn/data.md) attached to the discarded element.

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

