Edit this page

up.fragment up:fragment:keep
DOM event

This event is emitted before an existing element is kept during a page update.

Event listeners can call event.preventDefault() on an up:fragment:keep event to prevent the element from being persisted. If the event is prevented, the element will be replaced by a fragment from the response.



Event listeners may call this method to prevent the element from being preserved.

event.target Element

The fragment that will be kept.

event.newFragment Element

The discarded element.

event.newData Object

The value of the up-data attribute of the discarded element, parsed as a JSON object.

This website uses cookies to improve usability and analyze traffic.
I accept or learn more