Back to Content

NavigationCurrentEntryChangeEvent: from property

files/en-us/web/api/navigationcurrententrychangeevent/from/index.md

latest676 B
Original Source

{{APIRef("Navigation API")}}

The from read-only property of the {{domxref("NavigationCurrentEntryChangeEvent")}} interface returns the {{domxref("NavigationHistoryEntry")}} that was navigated from.

Value

A {{domxref("NavigationHistoryEntry")}} object.

Examples

js
navigation.addEventListener("currententrychange", (event) => {
  console.log(event.from);
});

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also