1. Web
  2. Web APIs
  3. NavigateEvent
  4. sourceElement

NavigateEvent: sourceElement property

The sourceElement read-only property of the NavigateEvent interface returns an Element object representing the initiating element, in cases where the navigation was initiated by an element.

The initiating element can be:

Value

An Element object representing the element that initiated the navigation, or null if the navigation was not initiated by an element.

Examples

Getting the sourceElement for an event

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

Specifications

Specification
HTML
# dom-navigateevent-sourceelement

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /