Baseline 2023
Newly available
The oldState
read-only property of the ToggleEvent
interface is a string representing the state the element is transitioning from.
A string. Possible values are "open"
(the popover is going from showing to hidden) or "closed"
(the popover going from hidden to shown).
const popover = document.getElementById("mypopover");
// â¦
popover.addEventListener("beforetoggle", (event) => {
if (event.oldState === "open") {
console.log("Popover is being hidden");
} else {
console.log("Popover is being shown");
}
});
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3