https://developer.mozilla.org/en-US/docs/Web/API/ToggleEvent/oldState
ToggleEvent: oldState property - Web APIs | MDN
The oldState read-only property of the ToggleEvent interface is a string representing the state the element is transitioning from.
web apispropertymdn