NavigateEvent: sourceElement property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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 iniated the navigation, or null if the navigation was not initiated by an element.

Examples

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

Specifications

Specification
HTML
# dom-navigateevent-sourceelement

Browser compatibility

See also