ToggleEvent sourceBaseline · Newly available
The source property of a ToggleEvent object is the element which triggered the toggle event to fire for a popover, <dialog>, or <details> element, if applicable.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since May 11, 2026.
Browser support
DesktopChrome
1–139Not supported
140+Supportedsince Sep 2, 2025
Current: 155Edge
12–139Not supported
140+Supportedsince Sep 5, 2025
Current: 154Firefox
1–144Not supported
145+Supportedsince Nov 11, 2025
Current: 157Safari
1–26.4Not supported
26.5+Supportedsince May 11, 2026
Current: 27MobileChrome Android
18–139Not supported
140+Supportedsince Sep 2, 2025
Current: 155Firefox Android
4–144Not supported
145+Supportedsince Nov 11, 2025
Current: 157Safari iOS
1–26.4Not supported
26.5+Supportedsince May 11, 2026
Current: 27How to use
Every current browser supports this, but it only became Baseline on May 11, 2026. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: source.
Feature detection
JS · check before using
if ("ToggleEvent" in globalThis && "source" in ToggleEvent.prototype) {
// ToggleEvent.source is available
}