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:
<a> element (or SVG <a> element).<area> element.<input type="submit"> or <button type="submit">).<form> element.An Element object representing the element that initiated the navigation, or null if the navigation was not initiated by an element.
navigation.addEventListener("navigate", (event) => {
console.log(event.sourceElement);
});
| Specification |
|---|
| HTML> # dom-navigateevent-sourceelement> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
sourceElement |
135 | 135 | No | 120 | No | No | No | No | No | No | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/NavigateEvent/sourceElement